AlonsoYSal_FactuGES2/Source/Modulos/Contratos de cliente/Views/uEditorFechaDecisionContrato.pas

75 lines
1.7 KiB
ObjectPascal

unit uEditorFechaDecisionContrato;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uDialogBase, ActnList, StdCtrls, ExtCtrls, ComCtrls;
type
TfEditorFechaDecisionContrato = class(TfDialogBase)
edtFechaDecision: TDateTimePicker;
Label1: TLabel;
procedure actAceptarExecute(Sender: TObject);
procedure actCancelarExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
private
function GetDate: TDate;
procedure SetDate(const Value: TDate);
public
property Fecha : TDate read GetDate write SetDate;
end;
function ElegirFechaDecisionContrato(var AFecha : TDate): Boolean;
implementation
{$R *.dfm}
function ElegirFechaDecisionContrato(var AFecha : TDate): Boolean;
var
AEditor : TfEditorFechaDecisionContrato;
begin
AEditor := TfEditorFechaDecisionContrato.Create(NIL);
try
AEditor.Fecha := AFecha;
Result := (AEditor.ShowModal = mrOk);
if Result then
AFecha := AEditor.Fecha;
finally
AEditor.Release;
end;
end;
procedure TfEditorFechaDecisionContrato.actAceptarExecute(Sender: TObject);
begin
inherited;
ModalResult := mrOK;
end;
procedure TfEditorFechaDecisionContrato.actCancelarExecute(Sender: TObject);
begin
inherited;
ModalResult := mrCancel;
end;
procedure TfEditorFechaDecisionContrato.FormShow(Sender: TObject);
begin
inherited;
edtFechaDecision.Date := Now;
end;
function TfEditorFechaDecisionContrato.GetDate: TDate;
begin
Result := edtFechaDecision.Date;
end;
procedure TfEditorFechaDecisionContrato.SetDate(const Value: TDate);
begin
edtFechaDecision.Date := Value;
end;
end.