source: cprs/branches/foia-cprs/CPRS-Chart/fNoteDR.pas@ 594

Last change on this file since 594 was 459, checked in by Kevin Toppenberg, 16 years ago

Adding foia-cprs branch

File size: 1.8 KB
Line 
1unit fNoteDR;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 fAutoSz, StdCtrls;
8
9type
10 TfrmNoteDelReason = class(TfrmAutoSz)
11 lblInstruction: TStaticText;
12 cmdOK: TButton;
13 cmdCancel: TButton;
14 radPrivacy: TRadioButton;
15 radAdmin: TRadioButton;
16 procedure FormCreate(Sender: TObject);
17 procedure cmdOKClick(Sender: TObject);
18 procedure cmdCancelClick(Sender: TObject);
19 private
20 OKPressed: Boolean;
21 end;
22
23function SelectDeleteReason(ANote: Integer): string;
24
25implementation
26
27{$R *.DFM}
28
29uses ORFn, rTIU, uConst;
30
31const
32 TX_REQRSN = 'A reason must be selected, otherwise press cancel.';
33 TC_REQRSN = 'Reason Required';
34
35function SelectDeleteReason(ANote: Integer): string;
36var
37 frmNoteDelReason: TfrmNoteDelReason;
38begin
39 if not JustifyDocumentDelete(ANote) then
40 begin
41 Result := DR_NOTREQ;
42 Exit;
43 end;
44 Result := DR_CANCEL;
45 frmNoteDelReason := TfrmNoteDelReason.Create(Application);
46 try
47 ResizeFormToFont(TForm(frmNoteDelReason));
48 frmNoteDelReason.ShowModal;
49 with frmNoteDelReason do if OKPressed then
50 begin
51 if radPrivacy.Checked then Result := DR_PRIVACY;
52 if radAdmin.Checked then Result := DR_ADMIN;
53 end;
54 finally
55 frmNoteDelReason.Release;
56 end;
57end;
58
59procedure TfrmNoteDelReason.FormCreate(Sender: TObject);
60begin
61 inherited;
62 OKPressed := False;
63end;
64
65procedure TfrmNoteDelReason.cmdOKClick(Sender: TObject);
66begin
67 inherited;
68 if not (radPrivacy.Checked or radAdmin.Checked) then
69 begin
70 InfoBox(TX_REQRSN, TC_REQRSN, MB_OK);
71 Exit;
72 end;
73 OKPressed := True;
74 Close;
75end;
76
77procedure TfrmNoteDelReason.cmdCancelClick(Sender: TObject);
78begin
79 inherited;
80 Close;
81end;
82
83end.
Note: See TracBrowser for help on using the repository browser.