Ignore:
Timestamp:
May 7, 2015, 12:34:29 PM (9 years ago)
Author:
healthsevak
Message:

Updating the working copy to CPRS version 28

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/trunk/CPRS-Chart/Options/fOptionsOther.pas

    r829 r1679  
    4848    procedure txtEncStopExit(Sender: TObject);
    4949    procedure btnEncDefaultsClick(Sender: TObject);
     50    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
     51    procedure btnCancelClick(Sender: TObject);
    5052  private
    5153    { Private declarations }
     
    5355    FstopDt: TFMDateTime;
    5456    FEncStartDays, FEncStopDays, FEncDefStartDays, FEncDefStopDays: integer;
     57    OK2Closed: boolean;
    5558    //FDefaultEvent: string;
    5659  public
     
    107110  values, tab: string;
    108111begin
     112  OK2Closed := True;
    109113  FastAssign(rpcGetOtherTabs, cboTab.Items);
    110114  if (cboTab.Items.IndexOf('Surgery') > -1) and (not ShowSurgeryTab) then
     
    142146  values, theVal: string;
    143147begin
     148  OK2Closed := True;
    144149  values := '';
    145150  if cboTab.ItemIEN <> cboTab.Tag then
     
    154159  values := values + '^^';
    155160  rpcSetOther(values);
     161   if (dtStart.Text = '') and (dtStop.Text = '') then
     162    begin
     163      if InfoBox('A date range is not set for the meds tab. Continue?', 'No Date Range Defined', MB_YESNO) = ID_NO then
     164      begin
     165         dtStart.SetFocus;
     166         OK2Closed := false;
     167         Exit;
     168      end;
     169    end
     170  else if (dtStart.Text = '') or (dtStop.Text = '') then
     171    begin
     172      ShowMsg('A complete date range needs to be set. ');
     173      if dtStart.Text = '' then dtStart.SetFocus
     174      else dtStop.SetFocus;
     175      OK2Closed := false;
     176      Exit;
     177    end;
     178  //if Pos('Y', Uppercase(dtStart.Text))>0 then
     179  if Uppercase(Copy(dtStart.Text, Length(dtStart.Text), Length(dtStart.Text))) = 'Y' then
     180
     181    begin
     182      ShowMsg('Start Date relative date cannot have a Y');
     183      OK2Closed := false;
     184      dtStart.SetFocus;
     185      Exit;
     186    end;
     187  //if Pos('Y', Uppercase(dtStop.Text))>0 then
     188  if Uppercase(Copy(dtStop.Text, Length(dtStop.Text), Length(dtStop.Text))) = 'Y' then
     189    begin
     190      ShowMsg('Stop Date relative date cannot have a Y');
     191      OK2Closed := false;
     192      dtStart.SetFocus;
     193      Exit;
     194    end;
    156195  if (dtStop.FMDateTime > 0) and (dtStart.FMDateTime > 0) then
    157196  begin
     
    161200      dtStop.FMDateTime := FMToday;
    162201      dtStop.SetFocus;
     202      OK2Closed := false;
    163203      Exit;
    164204    end;
     
    173213end;
    174214
     215procedure TfrmOptionsOther.FormCloseQuery(Sender: TObject;
     216  var CanClose: Boolean);
     217begin
     218  inherited;
     219  CanClose := OK2Closed;
     220 
     221end;
     222
    175223procedure TfrmOptionsOther.FormCreate(Sender: TObject);
    176224begin
     
    204252procedure TfrmOptionsOther.dtStartChange(Sender: TObject);
    205253begin
    206   if (dtStart.FMDateTime > FMToday) then
     254 (* if (dtStart.FMDateTime > FMToday) then
    207255  begin
    208256    ShowMsg('Start time can not greater than today.');
     
    210258    dtStart.SetFocus;
    211259    Exit;
    212   end;
     260  end;    *)
    213261end;
    214262
     
    265313end;
    266314
     315procedure TfrmOptionsOther.btnCancelClick(Sender: TObject);
     316begin
     317  inherited;
     318  OK2Closed := True;
     319end;
     320
    267321procedure TfrmOptionsOther.btnEncDefaultsClick(Sender: TObject);
    268322begin
Note: See TracChangeset for help on using the changeset viewer.