AbetoDesign_FactuGES2/Source/Modulos/Contabilidad/Views/uEditorCuentaEspecial.pas

142 lines
4.3 KiB
ObjectPascal
Raw Normal View History

{
===============================================================================
Copyright (<EFBFBD>) 2006. Rodax Software.
===============================================================================
Los contenidos de este fichero son propiedad de Rodax Software titular del
copyright. Este fichero s<EFBFBD>lo podr<EFBFBD> ser copiado, distribuido y utilizado,
en su totalidad o en parte, con el permiso escrito de Rodax Software, o de
acuerdo con los t<EFBFBD>rminos y condiciones establecidas en el acuerdo/contrato
bajo el que se suministra.
-----------------------------------------------------------------------------
Web: www.rodax-software.com
===============================================================================
Fecha primera versi<EFBFBD>n: 22-05-2006
Versi<EFBFBD>n actual: 1.0.0
Fecha versi<EFBFBD>n actual: 22-05-2006
===============================================================================
Modificaciones:
Fecha Comentarios
---------------------------------------------------------------------------
===============================================================================
}
unit uEditorCuentaEspecial;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Grids, DBGrids, StdCtrls, Mask, DBCtrls, DB,
uBizCuentasEspeciales, uCuentasEspecialesController,
uDADataTable, uIEditorCuentaEspecial, ActnList, ExtCtrls, JvExControls,
JvComponent, JvEnterTab, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
cxDataStorage, cxEdit, cxDBData, cxSpinEdit, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls,
cxGridCustomView, cxGrid, uDAInterfaces;
type
TfEditorCuentaEspecial = class(TForm, IEditorCuentaEspecial)
ActionList1: TActionList;
actAceptar: TAction;
actCancelar: TAction;
bAceptar: TButton;
bCancelar: TButton;
actCerrar: TAction;
actModificar: TAction;
eReferencia: TDBEdit;
eDescripcion: TDBEdit;
dsCuentasEspeciales: TDADataSource;
Label1: TLabel;
Bevel1: TBevel;
Label2: TLabel;
Label3: TLabel;
Bevel4: TBevel;
JvEnterAsTab1: TJvEnterAsTab;
procedure FormShow(Sender: TObject);
procedure actAceptarExecute(Sender: TObject);
procedure actCancelarExecute(Sender: TObject);
procedure actCerrarExecute(Sender: TObject);
protected
FCuentaEspecial: IBizCuentaEspecial;
FController : ICuentasEspecialesController;
function GetCuentaEspecial: IBizCuentaEspecial;
procedure SetCuentaEspecial(const Value: IBizCuentaEspecial);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property CuentaEspecial: IBizCuentaEspecial read GetCuentaEspecial write SetCuentaEspecial;
end;
implementation
{$R *.dfm}
{ TfEditorCuentasEspeciales }
uses
Dialogs, uDialogUtils;
function TfEditorCuentaEspecial.GetCuentaEspecial: IBizCuentaEspecial;
begin
Result := FCuentaEspecial;
end;
procedure TfEditorCuentaEspecial.SetCuentaEspecial(const Value: IBizCuentaEspecial);
begin
FCuentaEspecial := Value;
if Assigned(FCuentaEspecial) then
begin
dsCuentasEspeciales.DataTable := FCuentaEspecial.DataTable;
dsCuentasEspeciales.DataTable.Open;
end
else begin
dsCuentasEspeciales.DataTable := NIL;
end;
end;
constructor TfEditorCuentaEspecial.Create(AOwner: TComponent);
begin
inherited;
FController := TCuentasEspecialesController.Create;
end;
destructor TfEditorCuentaEspecial.Destroy;
begin
FCuentaEspecial := NIL;
FController := NIL;
inherited;
end;
procedure TfEditorCuentaEspecial.actAceptarExecute(Sender: TObject);
begin
if FController.Guardar(FCuentaEspecial) then
actCerrar.Execute;
end;
procedure TfEditorCuentaEspecial.actCancelarExecute(Sender: TObject);
begin
FController.DescartarCambios(FCuentaEspecial);
actCerrar.Execute;
end;
procedure TfEditorCuentaEspecial.actCerrarExecute(Sender: TObject);
begin
Close;
end;
procedure TfEditorCuentaEspecial.FormShow(Sender: TObject);
begin
if not FCuentaEspecial.DataTable.Active then
FCuentaEspecial.DataTable.Active := True;
if FCuentaEspecial.EsNuevo then
Self.Caption := 'Nueva cuenta especial'
else
Self.Caption := 'Modificar cuenta especial';
end;
end.