[453] | 1 | //kt -- Modified with SourceScanner on 8/8/2007
|
---|
| 2 | unit fOrdersUnhold;
|
---|
| 3 |
|
---|
| 4 | interface
|
---|
| 5 |
|
---|
| 6 | uses
|
---|
| 7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
| 8 | fAutoSz, StdCtrls, ORFn, ORCtrls, DKLang;
|
---|
| 9 |
|
---|
| 10 | type
|
---|
| 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 |
|
---|
| 23 | function ExecuteUnholdOrders(SelectedList: TList): Boolean;
|
---|
| 24 |
|
---|
| 25 | implementation
|
---|
| 26 |
|
---|
| 27 | {$R *.DFM}
|
---|
| 28 |
|
---|
| 29 | uses rOrders, uConst, uCore;
|
---|
| 30 |
|
---|
| 31 | function ExecuteUnholdOrders(SelectedList: TList): Boolean;
|
---|
| 32 | var
|
---|
| 33 | frmUnholdOrders: TfrmUnholdOrders;
|
---|
| 34 | OriginalID: string;
|
---|
| 35 | i: Integer;
|
---|
| 36 | begin
|
---|
| 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;
|
---|
| 58 | end;
|
---|
| 59 |
|
---|
| 60 | procedure TfrmUnholdOrders.FormCreate(Sender: TObject);
|
---|
| 61 | begin
|
---|
| 62 | inherited;
|
---|
| 63 | OKPressed := False;
|
---|
| 64 | end;
|
---|
| 65 |
|
---|
| 66 | procedure TfrmUnholdOrders.cmdOKClick(Sender: TObject);
|
---|
| 67 | begin
|
---|
| 68 | inherited;
|
---|
| 69 | OKPressed := True;
|
---|
| 70 | Close;
|
---|
| 71 | end;
|
---|
| 72 |
|
---|
| 73 | procedure TfrmUnholdOrders.cmdCancelClick(Sender: TObject);
|
---|
| 74 | begin
|
---|
| 75 | inherited;
|
---|
| 76 | Close;
|
---|
| 77 | end;
|
---|
| 78 |
|
---|
| 79 | end.
|
---|