git-svn-id: https://192.168.0.254/svn/Proyectos.AlonsoYSal_FactuGES2/trunk@6 40301925-124e-1c4e-b97d-170ad7a8785b
75 lines
1.6 KiB
ObjectPascal
75 lines
1.6 KiB
ObjectPascal
unit uBizCuentas;
|
|
|
|
interface
|
|
|
|
uses
|
|
uDAInterfaces, uDADataTable, uDBSelectionListUtils, schContabilidadClient_Intf;
|
|
|
|
const
|
|
BIZ_CLIENT_Cuenta = 'Client.Cuenta';
|
|
|
|
type
|
|
IBizCuenta = interface(ICuentas)
|
|
['{F79E3238-1E0D-4FB6-9AF7-E5703619B067}']
|
|
function EsNuevo : Boolean;
|
|
end;
|
|
|
|
TBizCuenta = class(TCuentasDataTableRules, IBizCuenta, 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 IniciarValoresCuentaNueva;
|
|
function EsNuevo : Boolean;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{ TBizCuenta }
|
|
|
|
uses
|
|
SysUtils, uDataTableUtils, uFactuGES_App;
|
|
|
|
constructor TBizCuenta.Create(aDataTable: TDADataTable);
|
|
begin
|
|
inherited;
|
|
FSeleccionableInterface := TSeleccionable.Create(aDataTable);
|
|
end;
|
|
|
|
destructor TBizCuenta.Destroy;
|
|
begin
|
|
FSeleccionableInterface := NIL;
|
|
inherited;
|
|
end;
|
|
|
|
function TBizCuenta.EsNuevo: Boolean;
|
|
begin
|
|
Result := (ID < 0);
|
|
end;
|
|
|
|
procedure TBizCuenta.IniciarValoresCuentaNueva;
|
|
begin
|
|
ID_EJERCICIO := AppFactuGES.EjercicioActivo.ID;
|
|
ESTADO := AppFactuGES.EjercicioActivo.ESTADO;
|
|
end;
|
|
|
|
procedure TBizCuenta.OnNewRecord(Sender: TDADataTable);
|
|
begin
|
|
inherited;
|
|
IniciarValoresCuentaNueva;
|
|
end;
|
|
|
|
initialization
|
|
RegisterDataTableRules(BIZ_CLIENT_Cuenta, TBizCuenta);
|
|
|
|
finalization
|
|
|
|
end.
|
|
|