source: cprs/branches/tmg-cprs/CPRS-Chart/Orders/fOrdersUnhold.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: 1.8 KB
Line 
1//kt -- Modified with SourceScanner on 8/8/2007
2unit fOrdersUnhold;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 fAutoSz, StdCtrls, ORFn, ORCtrls, DKLang;
9
10type
11 TfrmUnholdOrders = class(TfrmAutoSz)
12 Label1: TLabel;
13 lstOrders: TCaptionListBox;
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 ExecuteUnholdOrders(SelectedList: TList): Boolean;
24
25implementation
26
27{$R *.DFM}
28
29uses rOrders, uConst, uCore;
30
31function ExecuteUnholdOrders(SelectedList: TList): Boolean;
32var
33 frmUnholdOrders: TfrmUnholdOrders;
34 OriginalID: string;
35 i: Integer;
36begin
37 Result := False;
38 if SelectedList.Count = 0 then Exit;
39 frmUnholdOrders := TfrmUnholdOrders.Create(Application);
40 try
41 ResizeFormToFont(TForm(frmUnholdOrders));
42 with SelectedList do for i := 0 to Count - 1 do
43 frmUnholdOrders.lstOrders.Items.Add(TOrder(Items[i]).Text);
44 frmUnholdOrders.ShowModal;
45 if frmUnholdOrders.OKPressed then
46 begin
47 with SelectedList do for i := 0 to Count - 1 do
48 begin
49 OriginalID := TOrder(Items[i]).ID;
50 ReleaseOrderHold(TOrder(Items[i]));
51 end;
52 Result := True;
53 end
54 else with SelectedList do for i := 0 to Count - 1 do UnlockOrder(TOrder(Items[i]).ID);
55 finally
56 frmUnholdOrders.Release;
57 end;
58end;
59
60procedure TfrmUnholdOrders.FormCreate(Sender: TObject);
61begin
62 inherited;
63 OKPressed := False;
64end;
65
66procedure TfrmUnholdOrders.cmdOKClick(Sender: TObject);
67begin
68 inherited;
69 OKPressed := True;
70 Close;
71end;
72
73procedure TfrmUnholdOrders.cmdCancelClick(Sender: TObject);
74begin
75 inherited;
76 Close;
77end;
78
79end.
Note: See TracBrowser for help on using the repository browser.