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

97 lines
3.0 KiB
ObjectPascal

unit uViewSubCuenta;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uViewBase, ExtCtrls, StdCtrls, Buttons, DB, uDADataTable,
DBCtrls, Grids, DBGrids, uBizSubCuentas, uSubCuentasController, Mask, ComCtrls, uCustomView,
JvComponent, JvFormAutoSize, cxControls, cxContainer, cxEdit, cxTextEdit,
cxDBEdit, dxLayoutControl, uDAInterfaces, cxGraphics, cxDropDownEdit,
cxImageComboBox, cxMaskEdit, cxCalendar, ImgList, PngImageList, ActnList;
type
IViewSubCuenta = interface(IViewBase)
['{F44F8AEF-CB9C-44D5-93DA-53D6AB6A2D29}']
function GetController : ISubCuentasController;
procedure SetController (const Value : ISubCuentasController);
property Controller : ISubCuentasController read GetController write SetController;
function GetSubCuenta: IBizSubCuenta;
procedure SetSubCuenta(const Value: IBizSubCuenta);
property SubCuenta: IBizSubCuenta read GetSubCuenta write SetSubCuenta;
end;
TfrViewSubCuenta = class(TfrViewBase, IViewSubCuenta)
DADataSource: TDADataSource;
dxLayoutControlSubCuentaGroup_Root: TdxLayoutGroup;
dxLayoutControlSubCuenta: TdxLayoutControl;
dxLayoutControlSubCuentaGroup1: TdxLayoutGroup;
dxLayoutControlSubCuentaItem3: TdxLayoutItem;
eReferencia: TcxDBTextEdit;
dxLayoutControlSubCuentaItem1: TdxLayoutItem;
eDescripcion: TcxDBTextEdit;
dxLayoutControlSubCuentaItem2: TdxLayoutItem;
eCuenta: TcxDBTextEdit;
dxLayoutControlSubCuentaItem4: TdxLayoutItem;
BitBtn3: TBitBtn;
dxLayoutControlSubCuentaGroup2: TdxLayoutGroup;
png: TActionList;
actCuenta: TAction;
SmallImages: TPngImageList;
procedure actCuentaExecute(Sender: TObject);
protected
FSubCuenta: IBizSubCuenta;
FController : ISubCuentasController;
function GetSubCuenta: IBizSubCuenta;
procedure SetSubCuenta(const Value: IBizSubCuenta);
function GetController : ISubCuentasController;
procedure SetController (const Value : ISubCuentasController);
public
property Controller : ISubCuentasController read GetController write SetController;
property SubCuenta: IBizSubCuenta read GetSubCuenta write SetSubCuenta;
end;
implementation
{$R *.dfm}
{ TfrViewSubCuentas }
{
******************************* TfrViewSubCuentas ********************************
}
procedure TfrViewSubCuenta.actCuentaExecute(Sender: TObject);
begin
inherited;
Controller.ElegirCuenta(SubCuenta);
end;
function TfrViewSubCuenta.GetController: ISubCuentasController;
begin
Result := FController;
end;
function TfrViewSubCuenta.GetSubCuenta: IBizSubCuenta;
begin
Result := FSubCuenta;
end;
procedure TfrViewSubCuenta.SetController(const Value: ISubCuentasController);
begin
FController := Value;
end;
procedure TfrViewSubCuenta.SetSubCuenta(const Value: IBizSubCuenta);
begin
FSubCuenta := Value;
if Assigned(FSubCuenta) then
DADataSource.DataTable := FSubCuenta.DataTable
else
DADataSource.DataTable := NIL;
end;
end.