Procedure

TfrmSignOrders.clstOrdersClickCheck

Module

fOrdersSign

Last Modified

7/15/2014 3:26:42 PM

Visibility

Public/Published

Owner

TfrmSignOrders

Declaration

procedure clstOrdersClickCheck(Sender: TObject);

Calls Hierarchy


TfrmSignOrders.clstOrdersClickCheck
 ├TSigItems.EnableSettings
 │ └TSigItems.TagToItem
 ├updateAllChilds
 │ └TSigItems.EnableSettings...
 ├TfrmSignOrders.ItemsAreChecked
 ├TfrmSignOrders.IsSignatureRequired
 └TfrmSignOrders.CSItemsAreChecked

Calls

Name Declaration Comments
TfrmSignOrders.CSItemsAreChecked function CSItemsAreChecked: Boolean; -
TSigItems.EnableSettings procedure EnableSettings(Index: integer; Checked: boolean); -
TfrmSignOrders.IsSignatureRequired function IsSignatureRequired:boolean; -
TfrmSignOrders.ItemsAreChecked function ItemsAreChecked: Boolean; -
updateAllChilds procedure updateAllChilds(CheckedStatus: boolean; ParentOrderId: string); -


Source

1097  procedure TfrmSignOrders.clstOrdersClickCheck(Sender: TObject);
1098  
1099     procedure updateAllChilds(CheckedStatus: boolean; ParentOrderId: string);
1100     var
1101       idx: integer;
1102     begin
1103       for idx := 0 to clstOrders.Items.Count - 1 do
1104          if TOrder(clstOrders.Items.Objects[idx]).ParentID = ParentOrderId then
1105          begin
1106             if clstOrders.Checked[idx] <> CheckedStatus then
1107             begin
1108                clstOrders.Checked[idx] := CheckedStatus;
1109                SigItems.EnableSettings(idx, clstOrders.checked[Idx]);
1110             end;
1111          end;
1112     end;
1113  
1114  begin
1115    with clstOrders do
1116    begin
1117      if Length(TOrder(Items.Objects[ItemIndex]).ParentID)>0 then
1118      begin
1119        SigItems.EnableSettings(ItemIndex, checked[ItemIndex]);
1120        updateAllChilds(checked[ItemIndex],TOrder(Items.Objects[ItemIndex]).ParentID);
1121      end else
1122        SigItems.EnableSettings(ItemIndex, checked[ItemIndex]);
1123    end;
1124    if ItemsAreChecked then
1125    begin
1126       lblESCode.Visible := IsSignatureRequired;
1127       txtESCode.Visible := IsSignatureRequired
1128    end
1129    else
1130    begin
1131      lblESCode.Visible := ItemsAreChecked or CSItemsAreChecked;
1132      txtESCode.Visible := ItemsAreChecked or CSItemsAreChecked;
1133    end;
1134  
1135    if txtESCode.Visible then txtESCode.SetFocus;
1136    
1137  end;