unit uBizEDIInventary;

interface

uses
  uDAInterfaces, uDADataTable, Classes,
  DB, Controls, schEDIInventaryClient_Intf;

const
  BIZ_INVRPT_CAB = 'BizInvRptCab';
  BIZ_INVRPT_LIN = 'BizInvRptLin';
  BIZ_INVRPT_CANT = 'BizInvRptCant';

type
  IBizEDIInv_Cab = interface(IRDX_CABINV)
    ['{95AB3EC1-B8CC-4DB0-8052-03D1D225AC69}']
  end;

  IBizEDIInv_Lin = interface(IRDX_LININV)
    ['{171361CD-EC4F-479C-9E86-2D369DEC4EA9}']
  end;

  IBizEDIInv_Cant = interface(IRDX_CANTINV)
    ['{A91F8700-BD74-475A-8677-B349BB79FC07}']
  end;

  TBizEDIInv_Cab = class(TRDX_CABINVDataTableRules, IBizEDIInv_Cab)
  protected
    procedure SetNUMDOCValue(const aValue: String); override;
    procedure SetTIPODOCValue(const aValue: String); override;
    procedure SetTIPOLIQValue(const aValue: String); override;
    procedure SetFECHAValue(const aValue: DateTime); override;
    procedure SetFECHALIQValue(const aValue: DateTime); override;
    procedure SetEMISORValue(const aValue: String); override;
    procedure SetRECEPTORValue(const aValue: String); override;
    procedure SetDPTOValue(const aValue: String); override;
    procedure SetCENTROValue(const aValue: String); override;
  end;

  TBizEDIInv_Lin = class(TRDX_LININVDataTableRules, IBizEDIInv_Lin)
  protected
    procedure SetNUMDOCValue(const aValue: String); override;
    procedure SetNUMLINValue(const aValue: Float); override;
    procedure SetCODARTValue(const aValue: String); override;
    procedure SetFAMILIAValue(const aValue: String); override;
    procedure SetBARRAValue(const aValue: String); override;
    procedure SetTALLAValue(const aValue: String); override;
    procedure SetMARCAValue(const aValue: String); override;
    procedure SetTAMANOValue(const aValue: String); override;
    procedure SetSERIEValue(const aValue: String); override;
    procedure SetCOLORValue(const aValue: String); override;
    procedure SetMODELOValue(const aValue: String); override;
    procedure SetDIBUJOValue(const aValue: String); override;
    procedure SetDESCRIPValue(const aValue: String); override;
  end;

  TBizEDIInv_Cant = class(TRDX_CANTINVDataTableRules, IBizEDIInv_Cant)
  protected
    procedure SetNUMDOCValue(const aValue: String); override;
    procedure SetNUMLINValue(const aValue: Float); override;
    procedure SetNUMCANTValue(const aValue: Float); override;
    procedure SetTIPOCANTValue(const aValue: String); override;
    procedure SetCANTIDADValue(const aValue: Float); override;
    procedure SetCENTROValue(const aValue: String); override;
    procedure SetTMOVValue(const aValue: String); override;
    procedure SetFACTValue(const aValue: String); override;
    procedure SetDEPTOValue(const aValue: String); override;
    procedure SetIDVENValue(const aValue: String); override;
  end;


implementation

uses
  Variants;

{ TBizEDIInv_Cab }

procedure TBizEDIInv_Cab.SetCENTROValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CABINVCENTRO].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CABINVCENTRO].AsString := aValue;
end;

procedure TBizEDIInv_Cab.SetDPTOValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CABINVDPTO].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CABINVDPTO].AsString := aValue;
end;

procedure TBizEDIInv_Cab.SetEMISORValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CABINVEMISOR].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CABINVEMISOR].AsString := aValue;
end;

procedure TBizEDIInv_Cab.SetFECHALIQValue(const aValue: DateTime);
begin
  if aValue = 0 then
    DataTable.Fields[idx_RDX_CABINVFECHALIQ].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CABINVFECHALIQ].AsDateTime := aValue;
end;

procedure TBizEDIInv_Cab.SetFECHAValue(const aValue: DateTime);
begin
  if aValue = 0 then
    DataTable.Fields[idx_RDX_CABINVFECHA].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CABINVFECHA].AsDateTime := aValue;
end;

procedure TBizEDIInv_Cab.SetNUMDOCValue(const aValue: String);
begin
  inherited;
end;

procedure TBizEDIInv_Cab.SetRECEPTORValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CABINVRECEPTOR].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CABINVRECEPTOR].AsString := aValue;
end;

procedure TBizEDIInv_Cab.SetTIPODOCValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CABINVTIPODOC].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CABINVTIPODOC].AsString := aValue;
end;

procedure TBizEDIInv_Cab.SetTIPOLIQValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CABINVTIPOLIQ].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CABINVTIPOLIQ].AsString := aValue;
end;

{ TBizEDIInv_Lin }

procedure TBizEDIInv_Lin.SetBARRAValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVBARRA].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVBARRA].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetCODARTValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVCODART].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVCODART].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetCOLORValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVCOLOR].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVCOLOR].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetDESCRIPValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVDESCRIP].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVDESCRIP].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetDIBUJOValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVDIBUJO].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVDIBUJO].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetFAMILIAValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVFAMILIA].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVFAMILIA].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetMARCAValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVMARCA].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVMARCA].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetMODELOValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVMODELO].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVMODELO].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetNUMDOCValue(const aValue: String);
begin
  inherited;
end;

procedure TBizEDIInv_Lin.SetNUMLINValue(const aValue: Float);
begin
  inherited;
end;

procedure TBizEDIInv_Lin.SetSERIEValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVSERIE].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVSERIE].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetTALLAValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVTALLA].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVTALLA].AsString := aValue;
end;

procedure TBizEDIInv_Lin.SetTAMANOValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_LININVTAMANO].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_LININVTAMANO].AsString := aValue;
end;

{ TBizEDIInv_Cant }

procedure TBizEDIInv_Cant.SetCANTIDADValue(const aValue: Float);
begin
  inherited;
end;

procedure TBizEDIInv_Cant.SetCENTROValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CANTINVCENTRO].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CANTINVCENTRO].AsString := aValue;
end;

procedure TBizEDIInv_Cant.SetDEPTOValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CANTINVDEPTO].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CANTINVDEPTO].AsString := aValue;
end;

procedure TBizEDIInv_Cant.SetFACTValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CANTINVFACT].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CANTINVFACT].AsString := aValue;
end;

procedure TBizEDIInv_Cant.SetIDVENValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CANTINVIDVEN].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CANTINVIDVEN].AsString := aValue;
end;

procedure TBizEDIInv_Cant.SetNUMCANTValue(const aValue: Float);
begin
  inherited;
end;

procedure TBizEDIInv_Cant.SetNUMDOCValue(const aValue: String);
begin
  inherited;
end;

procedure TBizEDIInv_Cant.SetNUMLINValue(const aValue: Float);
begin
  inherited;
end;

procedure TBizEDIInv_Cant.SetTIPOCANTValue(const aValue: String);
begin
  if Length(aValue) = 0 then
    DataTable.Fields[idx_RDX_CANTINVTIPOCANT].AsVariant := NULL
  else
    DataTable.Fields[idx_RDX_CANTINVTIPOCANT].AsString := aValue;
end;

procedure TBizEDIInv_Cant.SetTMOVValue(const aValue: String);
begin
  inherited;

end;

initialization
  RegisterDataTableRules(BIZ_INVRPT_CAB, TBizEDIInv_Cab);
  RegisterDataTableRules(BIZ_INVRPT_LIN, TBizEDIInv_Lin);
  RegisterDataTableRules(BIZ_INVRPT_CANT, TBizEDIInv_Cant);

finalization

end.
