unit schFamiliasClient_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_Familias = '{5E0E521B-7290-449D-9894-03C398EAC16B}'; { Data table names } nme_Familias = 'Familias'; { Familias fields } fld_FamiliasID = 'ID'; fld_FamiliasDESCRIPCION = 'DESCRIPCION'; { Familias field indexes } idx_FamiliasID = 0; idx_FamiliasDESCRIPCION = 1; type { IFamilias } IFamilias = interface(IDAStronglyTypedDataTable) ['{2AE94E1A-10A4-49E9-9644-4D2DD29A7C1E}'] { 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; { TFamiliasDataTableRules } TFamiliasDataTableRules = class(TIntfObjectDADataTableRules, IFamilias) 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; { TFamiliasDataTableRules } constructor TFamiliasDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TFamiliasDataTableRules.Destroy; begin inherited; end; function TFamiliasDataTableRules.GetIDValue: Integer; begin result := DataTable.Fields[idx_FamiliasID].AsInteger; end; procedure TFamiliasDataTableRules.SetIDValue(const aValue: Integer); begin DataTable.Fields[idx_FamiliasID].AsInteger := aValue; end; function TFamiliasDataTableRules.GetIDIsNull: boolean; begin result := DataTable.Fields[idx_FamiliasID].IsNull; end; procedure TFamiliasDataTableRules.SetIDIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_FamiliasID].AsVariant := Null; end; function TFamiliasDataTableRules.GetDESCRIPCIONValue: String; begin result := DataTable.Fields[idx_FamiliasDESCRIPCION].AsString; end; procedure TFamiliasDataTableRules.SetDESCRIPCIONValue(const aValue: String); begin DataTable.Fields[idx_FamiliasDESCRIPCION].AsString := aValue; end; function TFamiliasDataTableRules.GetDESCRIPCIONIsNull: boolean; begin result := DataTable.Fields[idx_FamiliasDESCRIPCION].IsNull; end; procedure TFamiliasDataTableRules.SetDESCRIPCIONIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_FamiliasDESCRIPCION].AsVariant := Null; end; initialization RegisterDataTableRules(RID_Familias, TFamiliasDataTableRules); end.