unit uBizAlmacenes;

interface

uses
  uDAInterfaces, uDADataTable, schAlmacenesClient_Intf;

const
  BIZ_CLIENT_ALMACEN = 'Client.Almacen';

type
  IBizAlmacen = interface(IAlmacenes)
  ['{4DEDACCD-5CC1-474A-BE9A-46D3BCCF9025}']
		function EsNuevo : Boolean;
  end;

  TBizAlmacen = class(TAlmacenesDataTableRules, IBizAlmacen)
  protected
    procedure OnNewRecord(Sender: TDADataTable); override;

  public
		function EsNuevo : Boolean;
  end;

implementation

uses
	uFactuGES_App;

{ TBizAlmacen }

function TBizAlmacen.EsNuevo: Boolean;
begin
  Result := (ID < 0);
end;

procedure TBizAlmacen.OnNewRecord(Sender: TDADataTable);
begin
  inherited;
//  ID := GetRecNo; // -1, -2, -3...
  ID_EMPRESA := AppFactuGES.EmpresaActiva.ID;
  USUARIO := AppFactuGES.UsuarioActivo.UserName;
end;

initialization
  RegisterDataTableRules(BIZ_CLIENT_ALMACEN, TBizAlmacen);

finalization

end.
