unit uBizDetalleColoresAlbaranCliente;

interface

uses
  uDADataTable, schAlbaranesClienteClient_Intf;

const
  BIZ_CLIENT_DETALLE_COLORES_ALBARAN_CLIENTE = 'Client.DetalleColoresAlbaran.Cliente';


type
  IBizDetalleColoresAlbaranCliente = interface(IAlbaranesCliente_Detalle_Color)
  ['{113DFD59-6E81-42AE-BFCE-216C6E08D207}']
  end;

  TBizDetalleColoresAlbaranCliente = class(TAlbaranesCliente_Detalle_ColorDataTableRules, IBizDetalleColoresAlbaranCliente)
  protected
    procedure OnNewRecord(Sender: TDADataTable); override;
    procedure BeforeInsert(Sender: TDADataTable); override;
  end;

implementation

uses
  DB;

{ TBizDetalleColoresAlbaranCliente }

procedure TBizDetalleColoresAlbaranCliente.BeforeInsert(Sender: TDADataTable);
var
  AMasterTable : TDADataTable;
begin
  inherited;
  AMasterTable := DataTable.GetMasterDataTable;
  if Assigned(AMasterTable) and (AMasterTable.State = dsInsert) then
    AMasterTable.Post;
end;

procedure TBizDetalleColoresAlbaranCliente.OnNewRecord(Sender: TDADataTable);
begin
  inherited;
end;

initialization
  RegisterDataTableRules(BIZ_CLIENT_DETALLE_COLORES_ALBARAN_CLIENTE, TBizDetalleColoresAlbaranCliente);

end.
