unit uBizDetallesAlbaranProveedor;

interface

uses
  uDADataTable, schAlbaranesProveedorClient_Intf, uDataTableUtils;

const
  BIZ_CLIENT_DETALLES_ALBARAN_PROVEEDOR = 'Client.DetallesAlbaran.Proveedor';


type
  IBizDetallesAlbaranProveedor = interface(IAlbaranesProveedor_Detalles)
  ['{B0D734DF-6734-4959-B200-1574E10D7673}']
  end;

  TBizDetallesAlbaranProveedor = class(TAlbaranesProveedor_DetallesDataTableRules, IBizDetallesAlbaranProveedor)
  private
    ContIdAux: Integer;

  protected
    procedure OnNewRecord(Sender: TDADataTable); override;

  public
    constructor Create(aDataTable: TDADataTable); override;
  end;

implementation

{ TBizDetallesAlbaranProveedor }

constructor TBizDetallesAlbaranProveedor.Create(aDataTable: TDADataTable);
begin
  inherited Create(aDataTable);
  ContIdAux := -1;
end;

procedure TBizDetallesAlbaranProveedor.OnNewRecord(Sender: TDADataTable);
begin
  inherited;
  ID := ContIdAux; // -1, -2, -3...
  Dec(ContIdAux);
end;

initialization
  RegisterDataTableRules(BIZ_CLIENT_DETALLES_ALBARAN_PROVEEDOR, TBizDetallesAlbaranProveedor);

end.
