[456] | 1 | unit fOCAccept;
|
---|
| 2 |
|
---|
| 3 | interface
|
---|
| 4 |
|
---|
| 5 | uses
|
---|
| 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
[1679] | 7 | fAutoSz, StdCtrls, ComCtrls, ORFn, ExtCtrls, VA508AccessibilityManager, rOrders, fOCMonograph;
|
---|
[456] | 8 |
|
---|
| 9 | type
|
---|
| 10 | TfrmOCAccept = class(TfrmAutoSz)
|
---|
| 11 | memChecks: TRichEdit;
|
---|
| 12 | pnlBottom: TPanel;
|
---|
| 13 | cmdAccept: TButton;
|
---|
| 14 | cmdCancel: TButton;
|
---|
[1679] | 15 | Button1: TButton;
|
---|
| 16 | procedure Button1Click(Sender: TObject);
|
---|
| 17 | procedure cmdCancelClick(Sender: TObject);
|
---|
| 18 | procedure FormResize(Sender: TObject);
|
---|
[456] | 19 | private
|
---|
| 20 | { Private declarations }
|
---|
| 21 | public
|
---|
| 22 | { Public declarations }
|
---|
| 23 | end;
|
---|
| 24 |
|
---|
| 25 | function AcceptOrderWithChecks(OCList: TStringList): Boolean;
|
---|
| 26 |
|
---|
| 27 | implementation
|
---|
| 28 |
|
---|
| 29 | {$R *.DFM}
|
---|
| 30 |
|
---|
| 31 | function AcceptOrderWithChecks(OCList: TStringList): Boolean;
|
---|
| 32 | var
|
---|
[1679] | 33 | i,j: Integer;
|
---|
[456] | 34 | frmOCAccept: TfrmOCAccept;
|
---|
[1679] | 35 | substring: String;
|
---|
| 36 | remOC: TStringList;
|
---|
| 37 | begin
|
---|
| 38 | remOC := TStringList.Create;
|
---|
[456] | 39 | Result := True;
|
---|
| 40 | if OCList.Count > 0 then
|
---|
| 41 | begin
|
---|
| 42 | frmOCAccept := TfrmOCAccept.Create(Application);
|
---|
| 43 | try
|
---|
| 44 | ResizeFormToFont(TForm(frmOCAccept));
|
---|
[1679] | 45 | frmOCAccept.Button1.Enabled := false;
|
---|
| 46 | if IsMonograph then frmOCAccept.Button1.Enabled := true;
|
---|
| 47 |
|
---|
[456] | 48 | for i := 0 to OCList.Count - 1 do
|
---|
| 49 | begin
|
---|
[1679] | 50 | substring := Copy(Piece(OCList[i], U, 4),0,2);
|
---|
| 51 | if substring='||' then
|
---|
| 52 | begin
|
---|
| 53 | substring := Copy(Piece(OCList[i], U, 4),3,Length(Piece(OCList[i], U, 4)));
|
---|
| 54 | GetXtraTxt(remOC,Piece(substring,'&',1),Piece(substring,'&',2));
|
---|
| 55 | frmOCAccept.memChecks.Lines.Add('('+inttostr(i+1)+' of '+inttostr(OCList.Count)+') ' + Piece(substring,'&',2));
|
---|
| 56 | for j:= 0 to remOC.Count - 1 do frmOCAccept.memChecks.Lines.Add(' '+remOC[j]);
|
---|
| 57 | frmOCAccept.memChecks.Lines.Add(' ');
|
---|
| 58 | end
|
---|
| 59 | else
|
---|
| 60 | begin
|
---|
| 61 | frmOCAccept.memChecks.Lines.Add('('+inttostr(i+1)+' of '+inttostr(OCList.Count)+') ' + Piece(OCList[i], U, 4));
|
---|
| 62 | end;
|
---|
| 63 |
|
---|
[456] | 64 | frmOCAccept.memChecks.Lines.Add('');
|
---|
| 65 | end;
|
---|
| 66 | frmOCAccept.memChecks.SelStart := 0;
|
---|
| 67 | frmOCAccept.memChecks.SelLength := 0;
|
---|
| 68 | Result := frmOCAccept.ShowModal = mrYes;
|
---|
| 69 | finally
|
---|
| 70 | frmOCAccept.Release;
|
---|
[1679] | 71 | remOC.Destroy;
|
---|
[456] | 72 | end;
|
---|
| 73 | end;
|
---|
| 74 | end;
|
---|
| 75 |
|
---|
[1679] | 76 | procedure TfrmOCAccept.Button1Click(Sender: TObject);
|
---|
| 77 | var
|
---|
| 78 | monoList: TStringList;
|
---|
| 79 | begin
|
---|
| 80 | inherited;
|
---|
| 81 | monoList := TStringList.Create;
|
---|
| 82 | GetMonographList(monoList);
|
---|
| 83 | ShowMonographs(monoList);
|
---|
| 84 | monoList.Free;
|
---|
| 85 | end;
|
---|
| 86 |
|
---|
| 87 | procedure TfrmOCAccept.cmdCancelClick(Sender: TObject);
|
---|
| 88 | begin
|
---|
| 89 | inherited;
|
---|
| 90 | DeleteMonograph;
|
---|
| 91 | end;
|
---|
| 92 |
|
---|
| 93 | procedure TfrmOCAccept.FormResize(Sender: TObject);
|
---|
| 94 | begin
|
---|
| 95 | inherited;
|
---|
| 96 | memChecks.Refresh;
|
---|
| 97 | end;
|
---|
| 98 |
|
---|
[456] | 99 | end.
|
---|