AlonsoYSal_FactuGES2/Source/Modulos/Familias/Model/schFamiliasClient_Intf.pas
2019-11-18 10:36:42 +00:00

135 lines
4.0 KiB
ObjectPascal

unit schFamiliasClient_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_Familias = '{C080B399-6DAA-4558-9E84-9DE0C6929783}';
{ 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)
['{05E4B82B-526F-4BF8-A3CA-E2095F4A73A5}']
{ 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.