source: cprs/branches/tmg-cprs/CPRS-Chart/Orders/fOrdersHold.pas@ 929

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

Initial upload of TMG-CPRS 1.0.26.69

File size: 1.9 KB
Line 
1//kt -- Modified with SourceScanner on 8/8/2007
2unit fOrdersHold;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 fAutoSz, StdCtrls, ORFn, ORCtrls, DKLang;
9
10type
11 TfrmHoldOrders = class(TfrmAutoSz)
12 lstOrders: TCaptionListBox;
13 Label1: TLabel;
14 cmdOK: TButton;
15 cmdCancel: TButton;
16 procedure FormCreate(Sender: TObject);
17 procedure cmdOKClick(Sender: TObject);
18 procedure cmdCancelClick(Sender: TObject);
19 private
20 OKPressed: Boolean;
21 end;
22
23function ExecuteHoldOrders(SelectedList: TList): Boolean;
24
25implementation
26
27{$R *.DFM}
28
29uses rOrders, uConst, uCore;
30
31function ExecuteHoldOrders(SelectedList: TList): Boolean;
32var
33 frmHoldOrders: TfrmHoldOrders;
34 OriginalID: string;
35 i: Integer;
36begin
37 Result := False;
38 if SelectedList.Count = 0 then Exit;
39 frmHoldOrders := TfrmHoldOrders.Create(Application);
40 try
41 ResizeFormToFont(TForm(frmHoldOrders));
42 with SelectedList do for i := 0 to Count - 1 do
43 frmHoldOrders.lstOrders.Items.Add(TOrder(Items[i]).Text);
44 frmHoldOrders.ShowModal;
45 if frmHoldOrders.OKPressed then
46 begin
47 with SelectedList do for i := 0 to Count - 1 do
48 begin
49 OriginalID := TOrder(Items[i]).ID;
50 HoldOrder(TOrder(Items[i]));
51 TOrder(Items[i]).ActionOn := OriginalID + '=HD';
52 SendMessage(Application.MainForm.Handle, UM_NEWORDER, ORDER_ACT, Integer(Items[i]));
53 end;
54 Result := True;
55 end
56 else with SelectedList do for i := 0 to Count - 1 do UnlockOrder(TOrder(Items[i]).ID);
57 finally
58 frmHoldOrders.Release;
59 end;
60end;
61
62procedure TfrmHoldOrders.FormCreate(Sender: TObject);
63begin
64 inherited;
65 OKPressed := False;
66end;
67
68procedure TfrmHoldOrders.cmdOKClick(Sender: TObject);
69begin
70 inherited;
71 OKPressed := True;
72 Close;
73end;
74
75procedure TfrmHoldOrders.cmdCancelClick(Sender: TObject);
76begin
77 inherited;
78 Close;
79end;
80
81end.
Note: See TracBrowser for help on using the repository browser.