unit uEditorFechaPago; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar, ExtCtrls, uEditorBasico, uIEditorFechaPago, cxCheckBox, uSubCuentasController, Buttons, cxDBEdit, cxGraphics, uCustomView, uViewBase, uViewCajasBancos; type TfEditorFechaPago = class(TfEditorBasico, IEditorFechaPago) Label1: TLabel; eFechaPago: TcxDateEdit; bAceptar: TButton; bCancelar: TButton; Label2: TLabel; Panel1: TPanel; frViewCajasBancos1: TfrViewCajasBancos; procedure FormShow(Sender: TObject); procedure eFechaPagoPropertiesChange(Sender: TObject); procedure BitBtn3Click(Sender: TObject); procedure bAceptarClick(Sender: TObject); private FFechaPago : TDateTime; function GetFechaPago: TDateTime; procedure SetFechaPago(const Value: TDateTime); function GetIgnorarContabilidad: Integer; procedure SetIgnorarContabilidad(const Value: Integer); function GetIdSubCuenta: Integer; procedure SetIdSubCuenta(const Value: Integer); public property FechaPago: TDateTime Read GetFechaPago write SetFechaPago; property IgnorarContabilidad: Integer Read GetIgnorarContabilidad write SetIgnorarContabilidad; property IdSubCuenta: Integer Read GetIdSubCuenta write SetIdSubCuenta; end; var fEditorFechaPago: TfEditorFechaPago; implementation {$R *.dfm} //uses uBizSubCuentas; procedure TfEditorFechaPago.bAceptarClick(Sender: TObject); begin // if (not eContabilizar.Checked) // and (eIdSubcuenta.Text = '') then // raise Exception.Create ('Es necesario que elija la SubCuenta donde se realizará el pago'); end; procedure TfEditorFechaPago.BitBtn3Click(Sender: TObject); //var // ASubCuenta: IBizSubcuenta; begin // ASubCuenta := FController.ElegirSubCuenta(FController.BuscarTodos,'sssss', False); // eIDSubcuenta.Text := IntToStr(ASubcuenta.ID); // eRefSubCuenta.Text := ASubcuenta.REF_SUBCUENTA; // eSubCuenta.Text := ASubcuenta.DESCRIPCION; // ASubCuenta := Nil; end; procedure TfEditorFechaPago.eFechaPagoPropertiesChange(Sender: TObject); begin FechaPago := eFechaPago.Date; end; procedure TfEditorFechaPago.FormShow(Sender: TObject); begin if (length(eFechaPago.Text) = 0) then eFechaPago.Date := Date; end; function TfEditorFechaPago.GetFechaPago: TDateTime; begin Result := FFechaPago; end; function TfEditorFechaPago.GetIdSubCuenta: Integer; begin Result := frViewCajasBancos1.IdSubCuenta; end; function TfEditorFechaPago.GetIgnorarContabilidad: Integer; begin Result := frViewCajasBancos1.eContabilizar.EditValue; end; procedure TfEditorFechaPago.SetFechaPago(const Value: TDateTime); begin FFechaPago := Value; eFechaPago.EditValue := FFechaPago; end; procedure TfEditorFechaPago.SetIdSubCuenta(const Value: Integer); begin frViewCajasBancos1.ElegirCajaBanco(Value); end; procedure TfEditorFechaPago.SetIgnorarContabilidad(const Value: Integer); begin frViewCajasBancos1.eContabilizar.EditValue := Value; end; end.