1 | //kt -- Modified with SourceScanner on 8/8/2007
|
---|
2 | unit fOrderUnflag;
|
---|
3 |
|
---|
4 | interface
|
---|
5 |
|
---|
6 | uses
|
---|
7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
8 | fAutoSz, StdCtrls, ComCtrls, ORFn, rOrders, ORCtrls, DKLang;
|
---|
9 |
|
---|
10 | type
|
---|
11 | TfrmUnflagOrder = class(TfrmAutoSz)
|
---|
12 | txtComment: TCaptionEdit;
|
---|
13 | Label1: TLabel;
|
---|
14 | cmdOK: TButton;
|
---|
15 | cmdCancel: TButton;
|
---|
16 | memReason: TMemo;
|
---|
17 | memOrder: TMemo;
|
---|
18 | procedure FormCreate(Sender: TObject);
|
---|
19 | procedure cmdOKClick(Sender: TObject);
|
---|
20 | procedure cmdCancelClick(Sender: TObject);
|
---|
21 | private
|
---|
22 | OKPressed: Boolean;
|
---|
23 | end;
|
---|
24 |
|
---|
25 | function ExecuteUnflagOrder(AnOrder: TOrder): Boolean;
|
---|
26 |
|
---|
27 | implementation
|
---|
28 |
|
---|
29 | {$R *.DFM}
|
---|
30 |
|
---|
31 | function ExecuteUnflagOrder(AnOrder: TOrder): Boolean;
|
---|
32 | var
|
---|
33 | frmUnflagOrder: TfrmUnflagOrder;
|
---|
34 | begin
|
---|
35 | Result := False;
|
---|
36 | frmUnflagOrder := TfrmUnflagOrder.Create(Application);
|
---|
37 | try
|
---|
38 | ResizeFormToFont(TForm(frmUnflagOrder));
|
---|
39 | with frmUnflagOrder do
|
---|
40 | begin
|
---|
41 | memOrder.SetTextBuf(PChar(AnOrder.Text));
|
---|
42 | LoadFlagReason(memReason.Lines, AnOrder.ID);
|
---|
43 | ShowModal;
|
---|
44 | if OKPressed then
|
---|
45 | begin
|
---|
46 | UnflagOrder(AnOrder, txtComment.Text);
|
---|
47 | Result := True;
|
---|
48 | end;
|
---|
49 | end;
|
---|
50 | finally
|
---|
51 | frmUnflagOrder.Release;
|
---|
52 | end;
|
---|
53 | end;
|
---|
54 |
|
---|
55 | procedure TfrmUnflagOrder.FormCreate(Sender: TObject);
|
---|
56 | begin
|
---|
57 | inherited;
|
---|
58 | OKPressed := False;
|
---|
59 | end;
|
---|
60 |
|
---|
61 | procedure TfrmUnflagOrder.cmdOKClick(Sender: TObject);
|
---|
62 | begin
|
---|
63 | inherited;
|
---|
64 | OKPressed := True;
|
---|
65 | Close;
|
---|
66 | end;
|
---|
67 |
|
---|
68 | procedure TfrmUnflagOrder.cmdCancelClick(Sender: TObject);
|
---|
69 | begin
|
---|
70 | inherited;
|
---|
71 | Close;
|
---|
72 | end;
|
---|
73 |
|
---|
74 |
|
---|
75 | end.
|
---|