unit schReferenciasClient_Intf; interface uses Classes, DB, schBase_Intf, SysUtils, uROClasses, uDADataTable, FmtBCD, uROXMLIntf; const { Data table rules ids Feel free to change them to something more human readable but make sure they are unique in the context of your application } RID_Referencias = '{156D5B25-C2AD-4959-B6AB-1D9403AB4FCE}'; { Data table names } nme_Referencias = 'Referencias'; { Referencias fields } fld_ReferenciasID = 'ID'; fld_ReferenciasID_EMPRESA = 'ID_EMPRESA'; fld_ReferenciasID_TIENDA = 'ID_TIENDA'; fld_ReferenciasCODIGO = 'CODIGO'; fld_ReferenciasVALOR = 'VALOR'; fld_ReferenciasDESCRIPCION = 'DESCRIPCION'; { Referencias field indexes } idx_ReferenciasID = 0; idx_ReferenciasID_EMPRESA = 1; idx_ReferenciasID_TIENDA = 2; idx_ReferenciasCODIGO = 3; idx_ReferenciasVALOR = 4; idx_ReferenciasDESCRIPCION = 5; type { IReferencias } IReferencias = interface(IDAStronglyTypedDataTable) ['{A12A8336-88E9-4B4A-9485-49E5BCA286C3}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); function GetIDIsNull: Boolean; procedure SetIDIsNull(const aValue: Boolean); function GetID_EMPRESAValue: Integer; procedure SetID_EMPRESAValue(const aValue: Integer); function GetID_EMPRESAIsNull: Boolean; procedure SetID_EMPRESAIsNull(const aValue: Boolean); function GetID_TIENDAValue: Integer; procedure SetID_TIENDAValue(const aValue: Integer); function GetID_TIENDAIsNull: Boolean; procedure SetID_TIENDAIsNull(const aValue: Boolean); function GetCODIGOValue: String; procedure SetCODIGOValue(const aValue: String); function GetCODIGOIsNull: Boolean; procedure SetCODIGOIsNull(const aValue: Boolean); function GetVALORValue: String; procedure SetVALORValue(const aValue: String); function GetVALORIsNull: Boolean; procedure SetVALORIsNull(const aValue: Boolean); function GetDESCRIPCIONValue: String; procedure SetDESCRIPCIONValue(const aValue: String); function GetDESCRIPCIONIsNull: Boolean; procedure SetDESCRIPCIONIsNull(const aValue: Boolean); { Properties } property ID: Integer read GetIDValue write SetIDValue; property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull; property ID_EMPRESA: Integer read GetID_EMPRESAValue write SetID_EMPRESAValue; property ID_EMPRESAIsNull: Boolean read GetID_EMPRESAIsNull write SetID_EMPRESAIsNull; property ID_TIENDA: Integer read GetID_TIENDAValue write SetID_TIENDAValue; property ID_TIENDAIsNull: Boolean read GetID_TIENDAIsNull write SetID_TIENDAIsNull; property CODIGO: String read GetCODIGOValue write SetCODIGOValue; property CODIGOIsNull: Boolean read GetCODIGOIsNull write SetCODIGOIsNull; property VALOR: String read GetVALORValue write SetVALORValue; property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull; property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; property DESCRIPCIONIsNull: Boolean read GetDESCRIPCIONIsNull write SetDESCRIPCIONIsNull; end; { TReferenciasDataTableRules } TReferenciasDataTableRules = class(TIntfObjectDADataTableRules, IReferencias) private protected { Property getters and setters } function GetIDValue: Integer; virtual; procedure SetIDValue(const aValue: Integer); virtual; function GetIDIsNull: Boolean; virtual; procedure SetIDIsNull(const aValue: Boolean); virtual; function GetID_EMPRESAValue: Integer; virtual; procedure SetID_EMPRESAValue(const aValue: Integer); virtual; function GetID_EMPRESAIsNull: Boolean; virtual; procedure SetID_EMPRESAIsNull(const aValue: Boolean); virtual; function GetID_TIENDAValue: Integer; virtual; procedure SetID_TIENDAValue(const aValue: Integer); virtual; function GetID_TIENDAIsNull: Boolean; virtual; procedure SetID_TIENDAIsNull(const aValue: Boolean); virtual; function GetCODIGOValue: String; virtual; procedure SetCODIGOValue(const aValue: String); virtual; function GetCODIGOIsNull: Boolean; virtual; procedure SetCODIGOIsNull(const aValue: Boolean); virtual; function GetVALORValue: String; virtual; procedure SetVALORValue(const aValue: String); virtual; function GetVALORIsNull: Boolean; virtual; procedure SetVALORIsNull(const aValue: Boolean); virtual; function GetDESCRIPCIONValue: String; virtual; procedure SetDESCRIPCIONValue(const aValue: String); virtual; function GetDESCRIPCIONIsNull: Boolean; virtual; procedure SetDESCRIPCIONIsNull(const aValue: Boolean); virtual; { Properties } property ID: Integer read GetIDValue write SetIDValue; property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull; property ID_EMPRESA: Integer read GetID_EMPRESAValue write SetID_EMPRESAValue; property ID_EMPRESAIsNull: Boolean read GetID_EMPRESAIsNull write SetID_EMPRESAIsNull; property ID_TIENDA: Integer read GetID_TIENDAValue write SetID_TIENDAValue; property ID_TIENDAIsNull: Boolean read GetID_TIENDAIsNull write SetID_TIENDAIsNull; property CODIGO: String read GetCODIGOValue write SetCODIGOValue; property CODIGOIsNull: Boolean read GetCODIGOIsNull write SetCODIGOIsNull; property VALOR: String read GetVALORValue write SetVALORValue; property VALORIsNull: Boolean read GetVALORIsNull write SetVALORIsNull; property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; property DESCRIPCIONIsNull: Boolean read GetDESCRIPCIONIsNull write SetDESCRIPCIONIsNull; public constructor Create(aDataTable: TDADataTable); override; destructor Destroy; override; end; implementation uses Variants, uROBinaryHelpers; { TReferenciasDataTableRules } constructor TReferenciasDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TReferenciasDataTableRules.Destroy; begin inherited; end; function TReferenciasDataTableRules.GetIDValue: Integer; begin result := DataTable.Fields[idx_ReferenciasID].AsInteger; end; procedure TReferenciasDataTableRules.SetIDValue(const aValue: Integer); begin DataTable.Fields[idx_ReferenciasID].AsInteger := aValue; end; function TReferenciasDataTableRules.GetIDIsNull: boolean; begin result := DataTable.Fields[idx_ReferenciasID].IsNull; end; procedure TReferenciasDataTableRules.SetIDIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_ReferenciasID].AsVariant := Null; end; function TReferenciasDataTableRules.GetID_EMPRESAValue: Integer; begin result := DataTable.Fields[idx_ReferenciasID_EMPRESA].AsInteger; end; procedure TReferenciasDataTableRules.SetID_EMPRESAValue(const aValue: Integer); begin DataTable.Fields[idx_ReferenciasID_EMPRESA].AsInteger := aValue; end; function TReferenciasDataTableRules.GetID_EMPRESAIsNull: boolean; begin result := DataTable.Fields[idx_ReferenciasID_EMPRESA].IsNull; end; procedure TReferenciasDataTableRules.SetID_EMPRESAIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_ReferenciasID_EMPRESA].AsVariant := Null; end; function TReferenciasDataTableRules.GetID_TIENDAValue: Integer; begin result := DataTable.Fields[idx_ReferenciasID_TIENDA].AsInteger; end; procedure TReferenciasDataTableRules.SetID_TIENDAValue(const aValue: Integer); begin DataTable.Fields[idx_ReferenciasID_TIENDA].AsInteger := aValue; end; function TReferenciasDataTableRules.GetID_TIENDAIsNull: boolean; begin result := DataTable.Fields[idx_ReferenciasID_TIENDA].IsNull; end; procedure TReferenciasDataTableRules.SetID_TIENDAIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_ReferenciasID_TIENDA].AsVariant := Null; end; function TReferenciasDataTableRules.GetCODIGOValue: String; begin result := DataTable.Fields[idx_ReferenciasCODIGO].AsString; end; procedure TReferenciasDataTableRules.SetCODIGOValue(const aValue: String); begin DataTable.Fields[idx_ReferenciasCODIGO].AsString := aValue; end; function TReferenciasDataTableRules.GetCODIGOIsNull: boolean; begin result := DataTable.Fields[idx_ReferenciasCODIGO].IsNull; end; procedure TReferenciasDataTableRules.SetCODIGOIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_ReferenciasCODIGO].AsVariant := Null; end; function TReferenciasDataTableRules.GetVALORValue: String; begin result := DataTable.Fields[idx_ReferenciasVALOR].AsString; end; procedure TReferenciasDataTableRules.SetVALORValue(const aValue: String); begin DataTable.Fields[idx_ReferenciasVALOR].AsString := aValue; end; function TReferenciasDataTableRules.GetVALORIsNull: boolean; begin result := DataTable.Fields[idx_ReferenciasVALOR].IsNull; end; procedure TReferenciasDataTableRules.SetVALORIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_ReferenciasVALOR].AsVariant := Null; end; function TReferenciasDataTableRules.GetDESCRIPCIONValue: String; begin result := DataTable.Fields[idx_ReferenciasDESCRIPCION].AsString; end; procedure TReferenciasDataTableRules.SetDESCRIPCIONValue(const aValue: String); begin DataTable.Fields[idx_ReferenciasDESCRIPCION].AsString := aValue; end; function TReferenciasDataTableRules.GetDESCRIPCIONIsNull: boolean; begin result := DataTable.Fields[idx_ReferenciasDESCRIPCION].IsNull; end; procedure TReferenciasDataTableRules.SetDESCRIPCIONIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_ReferenciasDESCRIPCION].AsVariant := Null; end; initialization RegisterDataTableRules(RID_Referencias, TReferenciasDataTableRules); end.