source: cprs/branches/foia-cprs/CPRS-Chart/Orders/fOrdersUnhold.pas@ 1643

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

Adding foia-cprs branch

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