unit schTarifasClient_Intf; interface uses Classes, DB, schBase_Intf, SysUtils, uROClasses, uDAInterfaces, 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_Tarifas = '{1B8648BA-6504-40D7-895E-0E0C86350008}'; { Data table names } nme_Tarifas = 'Tarifas'; { Tarifas fields } fld_TarifasID = 'ID'; fld_TarifasDESCRIPCION = 'DESCRIPCION'; { Tarifas field indexes } idx_TarifasID = 0; idx_TarifasDESCRIPCION = 1; type { ITarifas } ITarifas = interface(IDAStronglyTypedDataTable) ['{1634B087-FF78-4815-A64F-F4D1D59FC7C9}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); function GetIDIsNull: Boolean; procedure SetIDIsNull(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 DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; property DESCRIPCIONIsNull: Boolean read GetDESCRIPCIONIsNull write SetDESCRIPCIONIsNull; end; { TTarifasDataTableRules } TTarifasDataTableRules = class(TIntfObjectDADataTableRules, ITarifas) 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 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 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; { TTarifasDataTableRules } constructor TTarifasDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TTarifasDataTableRules.Destroy; begin inherited; end; function TTarifasDataTableRules.GetIDValue: Integer; begin result := DataTable.Fields[idx_TarifasID].AsInteger; end; procedure TTarifasDataTableRules.SetIDValue(const aValue: Integer); begin DataTable.Fields[idx_TarifasID].AsInteger := aValue; end; function TTarifasDataTableRules.GetIDIsNull: boolean; begin result := DataTable.Fields[idx_TarifasID].IsNull; end; procedure TTarifasDataTableRules.SetIDIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_TarifasID].AsVariant := Null; end; function TTarifasDataTableRules.GetDESCRIPCIONValue: String; begin result := DataTable.Fields[idx_TarifasDESCRIPCION].AsString; end; procedure TTarifasDataTableRules.SetDESCRIPCIONValue(const aValue: String); begin DataTable.Fields[idx_TarifasDESCRIPCION].AsString := aValue; end; function TTarifasDataTableRules.GetDESCRIPCIONIsNull: boolean; begin result := DataTable.Fields[idx_TarifasDESCRIPCION].IsNull; end; procedure TTarifasDataTableRules.SetDESCRIPCIONIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_TarifasDESCRIPCION].AsVariant := Null; end; initialization RegisterDataTableRules(RID_Tarifas, TTarifasDataTableRules); end.