unit uBizObras;

interface

uses
  uDAInterfaces, uDADataTable, schObrasClient_Intf;

const
  BIZ_CLIENT_OBRA = 'Client.Obra';

type
  IBizObra = interface(IObras)
  ['{B447622D-3BFA-4432-BDC8-FD93FA73D65F}']
		function EsNuevo : Boolean;
  end;

  TBizObra = class(TObrasDataTableRules, IBizObra)
  protected
    procedure OnNewRecord(Sender: TDADataTable); override;

  public
		function EsNuevo : Boolean;
  end;

implementation

uses
	uFactuGES_App;

{ TBizObra }

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

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

initialization
  RegisterDataTableRules(BIZ_CLIENT_OBRA, TBizObra);

finalization

end.
