Procedure

TfrmRemCoverSheet.SaveData

Module

fRemCoverSheet

Last Modified

7/15/2014 3:26:38 PM

Visibility

Private

Owner

TfrmRemCoverSheet

Declaration

procedure SaveData(FromApply: boolean);

Calls Hierarchy


TfrmRemCoverSheet.SaveData
 ├SetCoverSheetLevelData
 └TfrmRemCoverSheet.UpdateMasterListView
   ├TfrmRemCoverSheet.GetCurrent
   │ └TfrmRemCoverSheet.GetCoverSheetLvlData
   │   └GetCoverSheetLevelData
   └TfrmRemCoverSheet.UpdateButtons
     ├TfrmRemCoverSheet.GetCurrent...
     ├TfrmRemCoverSheet.GetIndex
     └TfrmRemCoverSheet.LockButtonUpdate
       ├TfrmRemCoverSheet.btnLockClick
       │ └TfrmRemCoverSheet.ChangeStatus
       │   ├TfrmRemCoverSheet.GetCurrent...
       │   ├TfrmRemCoverSheet.GetIndex
       │   ├TfrmRemCoverSheet.MarkListAsChanged
       │   │ └TfrmRemCoverSheet.UpdateView
       │   │   └TfrmRemCoverSheet.GetCurrent...
       │   ├TfrmRemCoverSheet.SetupItem
       │   └TfrmRemCoverSheet.LockButtonUpdate...
       └TfrmRemCoverSheet.btnAddClick
         └TfrmRemCoverSheet.ChangeStatus...

Called-By Hierarchy


       TfrmRemCoverSheet.SaveData
TfrmRemCoverSheet.btnApplyClick┤ 
   TfrmRemCoverSheet.btnOKClick┘ 

Calls

Name Declaration Comments
SetCoverSheetLevelData procedure SetCoverSheetLevelData(ALevel, AClass: string; Data: TStrings); -
TfrmRemCoverSheet.UpdateMasterListView procedure UpdateMasterListView; -

Called-By

Name Declaration Comments
TfrmRemCoverSheet.btnApplyClick procedure btnApplyClick(Sender: TObject); -
TfrmRemCoverSheet.btnOKClick procedure btnOKClick(Sender: TObject); -


Source

1554  procedure TfrmRemCoverSheet.SaveData(FromApply: boolean);
1555  var
1556    i, j: integer;
1557    tmpSL: TORStringList;
1558    DeleteIt, DoRefresh: boolean;
1559    Level, lvl: TRemCoverDataLevel;
1560    ALevel, AClass, Code, IEN: string;
1561  
1562  begin
1563    DoRefresh := FALSE;
1564    i := 0;
1565    while (i < FData.Count) do
1566    begin
1567      DeleteIt := FALSE;
1568      if(Piece(FData[i],U,2) = BoolChar[TRUE]) then
1569      begin
1570        tmpSL := TORStringList(FData.Objects[i]);
1571        if assigned(tmpSL) then
1572        begin
1573          Level := dlPackage;
1574          Code := copy(FData[i],1,1);
1575          for lvl := low(TRemCoverDataLevel) to high(TRemCoverDataLevel) do
1576          begin
1577            if DataCode[lvl] = Code then
1578            begin
1579              Level := lvl;
1580              break;
1581            end;
1582          end;
1583          if Level <> dlPackage then
1584          begin
1585            IEN := copy(Piece(FData[i],U,1),2,MaxInt);
1586            ALevel := InternalName[Level];
1587            ACLass := '';
1588            case Level of
1589              dlDivision, dlService, dlLocation, dlUser:
1590                ALevel := ALevel + '.`' + IEN;
1591              dlUserClass:
1592                AClass := IEN;
1593            end;
1594            for j := 0 to tmpSL.Count-1 do
1595              tmpSL[j] := pieces(tmpSL[j],U,1,2);
1596            SetCoverSheetLevelData(ALevel, AClass, tmpSL);
1597            tmpSL.Free;
1598            DeleteIt := TRUE;
1599            FDataSaved := TRUE;
1600            DoRefresh := TRUE;
1601          end;
1602        end;
1603      end;
1604      if DeleteIt then
1605        FData.Delete(i)
1606      else
1607        inc(i);
1608    end;
1609    if FromApply and DoRefresh then
1610      UpdateMasterListView;
1611  end;