AlonsoYSal_FactuGES2/Source/Modulos/Presupuestos de cliente/Views/uEditorFechaDecisionPresupuesto.pas
2019-11-18 10:36:42 +00:00

68 lines
1.5 KiB
ObjectPascal

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