Procedure

TfrmPtSel.cmdRemoveClick

Module

fPtSel

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmPtSel

Declaration

procedure cmdRemoveClick(Sender: TObject);

Calls Hierarchy


TfrmPtSel.cmdRemoveClick
 ├DeleteAlertForUser
 ├TfrmPtSel.AlertList
 │ └LoadNotifications
 ├TfrmPtSel.FormShow
 │ ├GetSortMethod
 │ └TfrmPtSel.lstvAlertsColumnClick
 │   ├TfrmPtSel.ReformatAlertDateTime
 │   └SetSortMethod
 └TfrmPtSel.ShowButts
   └TfrmPtSel.ShowDisabledButtonTexts

Calls

Name Declaration Comments
TfrmPtSel.AlertList procedure AlertList; -
DeleteAlertForUser procedure DeleteAlertForUser(XQAID: string); -
TfrmPtSel.FormShow procedure FormShow(Sender: TObject); -
TfrmPtSel.ShowButts procedure ShowButts(ShowButts: Boolean); -


Source

771   procedure TfrmPtSel.cmdRemoveClick(Sender: TObject);
772   var
773     i: integer;
774   begin
775     if FAlertsNotReady then exit;
776     with lstvAlerts do
777       begin
778         if SelCount <= 0 then Exit;
779         for i := 0 to Items.Count - 1 do
780           if Items[i].Selected then
781             begin
782               if Items[i].SubItems[7] = '1' then  //remove flag enabled
783                 DeleteAlertForUser(Items[i].SubItems[6])
784               else InfoBox('This alert cannot be removed.', Items[i].SubItems[0] + ': ' + Items[i].SubItems[4], MB_OK);
785             end;
786       end;
787     lstvAlerts.Clear;
788     AlertList;
789     FsortCol := -1;     //CA - display alerts in correct sort
790     FormShow(Sender);  //CA - display alerts in correct sort
791     if lstvAlerts.Items.Count = 0 then ShowButts(False);
792     if lstvAlerts.SelCount <= 0 then ShowButts(False);
793   end;