source: cprs/branches/tmg-cprs/CPRS-Chart/Orders/fOrderFlag.pas@ 1156

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

Initial upload of TMG-CPRS 1.0.26.69

File size: 2.9 KB
RevLine 
[453]1//kt -- Modified with SourceScanner on 8/8/2007
2unit fOrderFlag;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 fAutoSz, StdCtrls, ComCtrls, ORFn, rOrders, ORCtrls, DKLang;
9
10type
11 TfrmFlagOrder = class(TfrmAutoSz)
12 txtReason: TCaptionEdit;
13 Label1: TLabel;
14 cmdOK: TButton;
15 cmdCancel: TButton;
16 memOrder: TMemo;
17 lblAlertRecipient: TLabel;
18 cboAlertRecipient: TORComboBox;
19 procedure FormCreate(Sender: TObject);
20 procedure cmdOKClick(Sender: TObject);
21 procedure cmdCancelClick(Sender: TObject);
22 procedure cboOnExit(Sender: TObject);
23 procedure cboAlertRecipientNeedData(Sender: TObject;
24 const StartFrom: String; Direction, InsertAt: Integer);
25 private
26 OKPressed: Boolean;
27 end;
28
29function ExecuteFlagOrder(AnOrder: TOrder): Boolean;
30
31implementation
32
33{$R *.DFM}
34
35uses uCore, rCore;
36
37var AlertRecip: Int64;
38
39function ExecuteFlagOrder(AnOrder: TOrder): Boolean;
40var
41 frmFlagOrder: TfrmFlagOrder;
42begin
43 Result := False;
44 frmFlagOrder := TfrmFlagOrder.Create(Application);
45 try
46 ResizeFormToFont(TForm(frmFlagOrder));
47 //AlertRecip := User.DUZ;
48 with frmFlagOrder do
49 begin
50 memOrder.SetTextBuf(PChar(AnOrder.Text));
51 ShowModal;
52 if OKPressed then
53 begin
54 FlagOrder(AnOrder, txtReason.Text, AlertRecip);
55 Result := True;
56 end;
57 end;
58 finally
59 frmFlagOrder.Release;
60 AlertRecip := 0;
61 end;
62end;
63
64procedure TfrmFlagOrder.FormCreate(Sender: TObject);
65begin
66 inherited;
67 OKPressed := False;
68 cboAlertRecipient.InitLongList('');
69 //cboAlertRecipient.SelectByIEN(User.DUZ);
70end;
71
72procedure TfrmFlagOrder.cmdOKClick(Sender: TObject);
73//const
74//TX_REASON_REQ = 'A reason must be entered to flag an order.'; <-- original line. //kt 8/8/2007
75//TC_REASON_REQ = 'Reason Required'; <-- original line. //kt 8/8/2007
76var
77 TX_REASON_REQ : string; //kt
78 TC_REASON_REQ : string; //kt
79
80begin
81 inherited;
82 TX_REASON_REQ := DKLangConstW('fOrderFlag_A_reason_must_be_entered_to_flag_an_orderx');
83 TC_REASON_REQ := DKLangConstW('fOrderFlag_Reason_Required');
84 if txtReason.Text = '' then
85 begin
86 InfoBox(TX_REASON_REQ, TC_REASON_REQ, MB_OK);
87 Exit;
88 end;
89 cmdOK.SetFocus;
90 OKPressed := True;
91 Close;
92end;
93
94procedure TfrmFlagOrder.cmdCancelClick(Sender: TObject);
95begin
96 inherited;
97 Close;
98end;
99
100procedure TfrmFlagOrder.cboOnExit(Sender: TObject);
101begin
102 with cboAlertRecipient do
103 if (ItemIndex = -1) or (Text = '') then
104 begin
105 AlertRecip := -1;
106 ItemIndex := -1;
107 Text := '';
108 end
109 else
110 begin
111 AlertRecip := ItemIEN;
112 end;
113end;
114
115procedure TfrmFlagOrder.cboAlertRecipientNeedData(Sender: TObject;
116 const StartFrom: String; Direction, InsertAt: Integer);
117begin
118 cboAlertRecipient.ForDataUse(SubSetOfPersons(StartFrom, Direction));
119end;
120
121end.
Note: See TracBrowser for help on using the repository browser.