unit uBizDetallesContratoCliente;

interface

uses
  uDADataTable, schContratosClienteClient_Intf;

const
  BIZ_CLIENT_DETALLES_CONTRATO_CLIENTE = 'Client.DetallesContratoCliente';

type
  IBizDetallesContratoCliente = interface(IContratosCliente_Detalles)
  ['{8B3699BC-8B5E-4E69-8D13-D0385C729D9C}']
  end;

  TBizDetallesContratoCliente = class(TContratosCliente_DetallesDataTableRules, IBizDetallesContratoCliente)
  protected
    procedure OnNewRecord(Sender: TDADataTable); override;
    procedure BeforeInsert(Sender: TDADataTable); override;
  end;


implementation

{ TBizDetallesContratoCliente }

uses
  Dialogs, DB, uDataTableUtils, SysUtils, JclStrings;

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

procedure TBizDetallesContratoCliente.OnNewRecord(Sender: TDADataTable);
begin
  inherited;
  CANTIDAD := 1;
  VISIBLE := 1;
  VISIBLE2 := 1;
end;

initialization
  RegisterDataTableRules(BIZ_CLIENT_DETALLES_CONTRATO_CLIENTE, TBizDetallesContratoCliente);

end.
