unit schIdiomasClient_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_Idiomas = '{4F61C4BD-B1AE-42F0-89C4-61EA8B6FF50C}'; { Data table names } nme_Idiomas = 'Idiomas'; { Idiomas fields } fld_IdiomasID = 'ID'; fld_IdiomasISO = 'ISO'; fld_IdiomasDESCRIPCION = 'DESCRIPCION'; { Idiomas field indexes } idx_IdiomasID = 0; idx_IdiomasISO = 1; idx_IdiomasDESCRIPCION = 2; type { IIdiomas } IIdiomas = interface(IDAStronglyTypedDataTable) ['{C5751763-7409-41C0-90DA-36E28E0AAEB6}'] { Property getters and setters } function GetIDValue: Integer; procedure SetIDValue(const aValue: Integer); function GetIDIsNull: Boolean; procedure SetIDIsNull(const aValue: Boolean); function GetISOValue: String; procedure SetISOValue(const aValue: String); function GetISOIsNull: Boolean; procedure SetISOIsNull(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 ISO: String read GetISOValue write SetISOValue; property ISOIsNull: Boolean read GetISOIsNull write SetISOIsNull; property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; property DESCRIPCIONIsNull: Boolean read GetDESCRIPCIONIsNull write SetDESCRIPCIONIsNull; end; { TIdiomasDataTableRules } TIdiomasDataTableRules = class(TIntfObjectDADataTableRules, IIdiomas) 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 GetISOValue: String; virtual; procedure SetISOValue(const aValue: String); virtual; function GetISOIsNull: Boolean; virtual; procedure SetISOIsNull(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 ISO: String read GetISOValue write SetISOValue; property ISOIsNull: Boolean read GetISOIsNull write SetISOIsNull; 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; { TIdiomasDataTableRules } constructor TIdiomasDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TIdiomasDataTableRules.Destroy; begin inherited; end; function TIdiomasDataTableRules.GetIDValue: Integer; begin result := DataTable.Fields[idx_IdiomasID].AsInteger; end; procedure TIdiomasDataTableRules.SetIDValue(const aValue: Integer); begin DataTable.Fields[idx_IdiomasID].AsInteger := aValue; end; function TIdiomasDataTableRules.GetIDIsNull: boolean; begin result := DataTable.Fields[idx_IdiomasID].IsNull; end; procedure TIdiomasDataTableRules.SetIDIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_IdiomasID].AsVariant := Null; end; function TIdiomasDataTableRules.GetISOValue: String; begin result := DataTable.Fields[idx_IdiomasISO].AsString; end; procedure TIdiomasDataTableRules.SetISOValue(const aValue: String); begin DataTable.Fields[idx_IdiomasISO].AsString := aValue; end; function TIdiomasDataTableRules.GetISOIsNull: boolean; begin result := DataTable.Fields[idx_IdiomasISO].IsNull; end; procedure TIdiomasDataTableRules.SetISOIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_IdiomasISO].AsVariant := Null; end; function TIdiomasDataTableRules.GetDESCRIPCIONValue: String; begin result := DataTable.Fields[idx_IdiomasDESCRIPCION].AsString; end; procedure TIdiomasDataTableRules.SetDESCRIPCIONValue(const aValue: String); begin DataTable.Fields[idx_IdiomasDESCRIPCION].AsString := aValue; end; function TIdiomasDataTableRules.GetDESCRIPCIONIsNull: boolean; begin result := DataTable.Fields[idx_IdiomasDESCRIPCION].IsNull; end; procedure TIdiomasDataTableRules.SetDESCRIPCIONIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_IdiomasDESCRIPCION].AsVariant := Null; end; initialization RegisterDataTableRules(RID_Idiomas, TIdiomasDataTableRules); end.