unit schSubfamiliasClient_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_Subfamilias = '{F82AF22D-9966-4291-8247-F1A870F51A48}'; { Data table names } nme_Subfamilias = 'Subfamilias'; { Subfamilias fields } fld_SubfamiliasID = 'ID'; fld_SubfamiliasDESCRIPCION = 'DESCRIPCION'; { Subfamilias field indexes } idx_SubfamiliasID = 0; idx_SubfamiliasDESCRIPCION = 1; type { ISubfamilias } ISubfamilias = interface(IDAStronglyTypedDataTable) ['{4FF3D435-D406-4BD0-AD2A-F416A95D7519}'] { 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; { TSubfamiliasDataTableRules } TSubfamiliasDataTableRules = class(TIntfObjectDADataTableRules, ISubfamilias) 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; { TSubfamiliasDataTableRules } constructor TSubfamiliasDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TSubfamiliasDataTableRules.Destroy; begin inherited; end; function TSubfamiliasDataTableRules.GetIDValue: Integer; begin result := DataTable.Fields[idx_SubfamiliasID].AsInteger; end; procedure TSubfamiliasDataTableRules.SetIDValue(const aValue: Integer); begin DataTable.Fields[idx_SubfamiliasID].AsInteger := aValue; end; function TSubfamiliasDataTableRules.GetIDIsNull: boolean; begin result := DataTable.Fields[idx_SubfamiliasID].IsNull; end; procedure TSubfamiliasDataTableRules.SetIDIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_SubfamiliasID].AsVariant := Null; end; function TSubfamiliasDataTableRules.GetDESCRIPCIONValue: String; begin result := DataTable.Fields[idx_SubfamiliasDESCRIPCION].AsString; end; procedure TSubfamiliasDataTableRules.SetDESCRIPCIONValue(const aValue: String); begin DataTable.Fields[idx_SubfamiliasDESCRIPCION].AsString := aValue; end; function TSubfamiliasDataTableRules.GetDESCRIPCIONIsNull: boolean; begin result := DataTable.Fields[idx_SubfamiliasDESCRIPCION].IsNull; end; procedure TSubfamiliasDataTableRules.SetDESCRIPCIONIsNull(const aValue: Boolean); begin if aValue then DataTable.Fields[idx_SubfamiliasDESCRIPCION].AsVariant := Null; end; initialization RegisterDataTableRules(RID_Subfamilias, TSubfamiliasDataTableRules); end.