source: cprs/branches/tmg-cprs/CPRS-Chart/fNoteDR.pas@ 1085

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

Initial upload of TMG-CPRS 1.0.26.69

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