unit uBizSubCuentas; interface uses uDAInterfaces, uDADataTable, uDBSelectionListUtils, schContabilidadClient_Intf; const BIZ_CLIENT_SubCuenta = 'Client.SubCuenta'; type IBizSubCuenta = interface(ISubCuentas) ['{F79E3238-1E0D-4FB6-9AF7-E5703619B067}'] function EsNuevo : Boolean; end; TBizSubCuenta = class(TSubCuentasDataTableRules, IBizSubCuenta, ISeleccionable) protected FSeleccionableInterface: ISeleccionable; procedure OnNewRecord(Sender: TDADataTable); override; public property SeleccionableInterface : ISeleccionable read FSeleccionableInterface write FSeleccionableInterface implements ISeleccionable; constructor Create(aDataTable: TDADataTable); override; destructor Destroy; override; procedure IniciarValoresSubCuentaNueva; function EsNuevo : Boolean; end; implementation { TBizSubCuenta } uses SysUtils, uDataTableUtils, uFactuGES_App; constructor TBizSubCuenta.Create(aDataTable: TDADataTable); begin inherited; FSeleccionableInterface := TSeleccionable.Create(aDataTable); end; destructor TBizSubCuenta.Destroy; begin FSeleccionableInterface := NIL; inherited; end; function TBizSubCuenta.EsNuevo: Boolean; begin Result := (ID < 0); end; procedure TBizSubCuenta.IniciarValoresSubCuentaNueva; begin ID_EJERCICIO := AppFactuGES.EjercicioActivo.ID; ESTADO := AppFactuGES.EjercicioActivo.ESTADO; end; procedure TBizSubCuenta.OnNewRecord(Sender: TDADataTable); begin inherited; IniciarValoresSubCuentaNueva; end; initialization RegisterDataTableRules(BIZ_CLIENT_SubCuenta, TBizSubCuenta); finalization end.