source: cprs/trunk/CPRS-Chart/Orders/fOrdersUnhold.pas@ 1698

Last change on this file since 1698 was 1679, checked in by healthsevak, 10 years ago

Updating the working copy to CPRS version 28

File size: 2.0 KB
Line 
1unit fOrdersUnhold;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 fAutoSz, StdCtrls, ORFn, ORCtrls, VA508AccessibilityManager;
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 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;
59end;
60
61procedure TfrmUnholdOrders.FormCreate(Sender: TObject);
62begin
63 inherited;
64 OKPressed := False;
65end;
66
67procedure TfrmUnholdOrders.cmdOKClick(Sender: TObject);
68begin
69 inherited;
70 OKPressed := True;
71 Close;
72end;
73
74procedure TfrmUnholdOrders.cmdCancelClick(Sender: TObject);
75begin
76 inherited;
77 Close;
78end;
79
80end.
Note: See TracBrowser for help on using the repository browser.