Procedure

TfrmSurgery.mnuActLoadBoilerClick

Module

fSurgery

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmSurgery

Declaration

procedure mnuActLoadBoilerClick(Sender: TObject);

Calls Hierarchy


TfrmSurgery.mnuActLoadBoilerClick
 ├LoadBoilerPlate
 ├GetLinkedTemplate
 │ ├GetLinkedTemplateData
 │ └AddTemplate
 │   ├TTemplate.Create
 │   │ └TTemplate.ReminderDialogIEN
 │   └TTemplate.AddChild
 │     └TTemplate.GetItems
 │       └ExpandTemplate
 │         ├TTemplate.GetChildren
 │         ├GetTemplateChildren
 │         ├AddTemplate...
 │         └TTemplate.ItemIENs
 │           └TTemplate.GetItems...
 ├AssignBoilerText
 ├MakeXMLParamTIU
 │ └ExternalName
 └QueryBoilerPlate
   └TfrmBase508Form.Create
     ├TfrmBase508Form.UpdateAccessibilityActions
     ├UnfocusableControlEnter
     └AdjustControls
       ├TfrmBase508Form.ModifyUnfocusableControl
       └..(rec)..

Called-By Hierarchy


  TfrmSurgery.mnuActLoadBoilerClick
       TfrmSurgery.cmdChangeClick┘ 
      TfrmSurgery.InsertNewNote┤   
   TfrmSurgery.mnuActNewClick┘ │   
TfrmSurgery.cmdNewNoteClick┘   │   
     TfrmSurgery.InsertAddendum┤   
TfrmSurgery.mnuActAddendClick┘ │   
        TfrmSurgery.LoadForEdit┤   
  TfrmSurgery.mnuActEditClick┘ │   
  TfrmSurgery.mnuActChangeClick┘   

Calls

Name Declaration Comments
AssignBoilerText procedure AssignBoilerText; -
GetLinkedTemplate function GetLinkedTemplate(IEN: string; LType: TTemplateLinkType): TTemplate; -
LoadBoilerPlate procedure LoadBoilerPlate(Dest: TStrings; Title: Integer); -
MakeXMLParamTIU function MakeXMLParamTIU(ANoteID: string; ANoteRec: TEditNoteRec): string; overload; -
QueryBoilerPlate function QueryBoilerPlate(BPText: TStrings): Integer; -

Called-By

Name Declaration Comments
TfrmSurgery.cmdChangeClick procedure cmdChangeClick(Sender: TObject); -


Source

1270  procedure TfrmSurgery.mnuActLoadBoilerClick(Sender: TObject);
1271  var
1272    NoteEmpty: Boolean;
1273    BoilerText: TStringList;
1274    DocInfo: string;
1275  
1276    procedure AssignBoilerText;
1277    begin
1278      ExecuteTemplateOrBoilerPlate(BoilerText, FEditNote.Title, ltTitle, Self, 'Title: ' + FEditNote.TitleName, DocInfo);
1279      QuickCopy(BoilerText, memNewNote);
1280      FChanged := False;
1281    end;
1282  
1283  begin
1284    inherited;
1285    if (FEditingIndex < 0) or (lstNotes.ItemIndex <> FEditingIndex) then Exit;
1286    BoilerText := TStringList.Create;
1287    try
1288      NoteEmpty := memNewNote.Text = '';
1289      LoadBoilerPlate(BoilerText, FEditNote.Title);
1290      if (BoilerText.Text <> '') or
1291         assigned(GetLinkedTemplate(IntToStr(FEditNote.Title), ltTitle)) then
1292      begin
1293        if NoteEmpty then AssignBoilerText else
1294        begin
1295          DocInfo := MakeXMLParamTIU(IntToStr(lstNotes.ItemIEN), FEditNote);
1296          case QueryBoilerPlate(BoilerText) of
1297          0:  { do nothing } ;                         // ignore
1298          1: begin
1299               ExecuteTemplateOrBoilerPlate(BoilerText, FEditNote.Title, ltTitle, Self, 'Title: ' + FEditNote.TitleName, DocInfo);
1300               QuickAdd(BoilerText, memNewNote);  // append
1301             end;
1302          2: AssignBoilerText;                         // replace
1303          end;
1304        end;
1305      end else
1306      begin
1307        if Sender = mnuActLoadBoiler
1308          then InfoBox(TX_NO_BOIL, TC_NO_BOIL, MB_OK)
1309          else
1310          begin
1311            if not NoteEmpty then
1312              if not FChanged and (InfoBox(TX_BLR_CLEAR, TC_BLR_CLEAR, MB_YESNO) = ID_YES)
1313                then memNewNote.Lines.Clear;
1314          end;
1315      end; {if BoilerText.Text <> ''}
1316    finally
1317      BoilerText.Free;
1318    end;
1319  end;