unit uBizPedidosFacturaProveedor;

interface

uses
  uDAInterfaces, uDADataTable, schFacturasProveedorClient_Intf;

const
  BIZ_CLIENT_PEDIDOS_FACTURA_PROVEEDOR = 'Client.PedidosFacturaProveedor';

type
  IBizPedidosFacturaProveedor = interface(IFacturasProveedor_Pedidos)
  ['{D0426F98-561B-46F1-9ADC-31A8BB1D68F4}']
  end;

  TBizPedidosFacturaProveedor = class(TFacturasProveedor_PedidosDataTableRules, IBizPedidosFacturaProveedor)
  protected
    procedure OnNewRecord(Sender: TDADataTable); override;
    procedure BeforeInsert(Sender: TDADataTable); override;
  end;

implementation

uses
  SysUtils, DB;

{ TBizPedidosFacturaProveedor }

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

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

initialization
  RegisterDataTableRules(BIZ_CLIENT_PEDIDOS_FACTURA_PROVEEDOR, TBizPedidosFacturaProveedor);

end.
