unit uBizMovimientosDetalleColor;

interface

uses
  uDADataTable, schInventarioClient_Intf;

const
  BIZ_CLIENT_MOVIMIENTOS_DETALLE_COLOR = 'Client.MovimientosDetalleColor';


type
  IBizMovimientosDetalleColor = interface(IMovimientos_Detalle_Color)
  ['{D8145BFA-9DBC-4889-9FC4-7C7194A24BBF}']
  end;

  TBizMovimientosDetalleColor = class(TMovimientos_Detalle_ColorDataTableRules, IBizMovimientosDetalleColor)
  protected
    procedure OnNewRecord(Sender: TDADataTable); override;
    procedure BeforeInsert(Sender: TDADataTable); override;
  end;

implementation

uses
  DB;

{ TBizMovimientosDetalleColor }

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

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

initialization
  RegisterDataTableRules(BIZ_CLIENT_MOVIMIENTOS_DETALLE_COLOR, TBizMovimientosDetalleColor);

end.
