1 | unit fOrdersUnhold;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
7 | fAutoSz, StdCtrls, ORFn, ORCtrls, VA508AccessibilityManager;
|
---|
8 |
|
---|
9 | type
|
---|
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 |
|
---|
22 | function ExecuteUnholdOrders(SelectedList: TList): Boolean;
|
---|
23 |
|
---|
24 | implementation
|
---|
25 |
|
---|
26 | {$R *.DFM}
|
---|
27 |
|
---|
28 | uses rOrders, uConst, uCore;
|
---|
29 |
|
---|
30 | function ExecuteUnholdOrders(SelectedList: TList): Boolean;
|
---|
31 | var
|
---|
32 | frmUnholdOrders: TfrmUnholdOrders;
|
---|
33 | OriginalID: string;
|
---|
34 | i: Integer;
|
---|
35 | begin
|
---|
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 | TOrder(Items[i]).ActionOn := OriginalID + '=UH';
|
---|
51 | SendMessage(Application.MainForm.Handle, UM_NEWORDER, ORDER_ACT, Integer(Items[i]));
|
---|
52 | end;
|
---|
53 | Result := True;
|
---|
54 | end
|
---|
55 | else with SelectedList do for i := 0 to Count - 1 do UnlockOrder(TOrder(Items[i]).ID);
|
---|
56 | finally
|
---|
57 | frmUnholdOrders.Release;
|
---|
58 | end;
|
---|
59 | end;
|
---|
60 |
|
---|
61 | procedure TfrmUnholdOrders.FormCreate(Sender: TObject);
|
---|
62 | begin
|
---|
63 | inherited;
|
---|
64 | OKPressed := False;
|
---|
65 | end;
|
---|
66 |
|
---|
67 | procedure TfrmUnholdOrders.cmdOKClick(Sender: TObject);
|
---|
68 | begin
|
---|
69 | inherited;
|
---|
70 | OKPressed := True;
|
---|
71 | Close;
|
---|
72 | end;
|
---|
73 |
|
---|
74 | procedure TfrmUnholdOrders.cmdCancelClick(Sender: TObject);
|
---|
75 | begin
|
---|
76 | inherited;
|
---|
77 | Close;
|
---|
78 | end;
|
---|
79 |
|
---|
80 | end.
|
---|