Tecsitel_FactuGES2/Source/Modulos/Fabricantes/Model/schFabricantesClient_Intf.pas

135 lines
4.1 KiB
ObjectPascal

unit schFabricantesClient_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_Fabricantes = '{24607721-C2E1-4EFD-B898-307AC1462048}';
{ Data table names }
nme_Fabricantes = 'Fabricantes';
{ Fabricantes fields }
fld_FabricantesID = 'ID';
fld_FabricantesDESCRIPCION = 'DESCRIPCION';
{ Fabricantes field indexes }
idx_FabricantesID = 0;
idx_FabricantesDESCRIPCION = 1;
type
{ IFabricantes }
IFabricantes = interface(IDAStronglyTypedDataTable)
['{6018A1F9-F72E-46E2-A71E-C34CA806D20E}']
{ 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;
{ TFabricantesDataTableRules }
TFabricantesDataTableRules = class(TIntfObjectDADataTableRules, IFabricantes)
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;
{ TFabricantesDataTableRules }
constructor TFabricantesDataTableRules.Create(aDataTable: TDADataTable);
begin
inherited;
end;
destructor TFabricantesDataTableRules.Destroy;
begin
inherited;
end;
function TFabricantesDataTableRules.GetIDValue: Integer;
begin
result := DataTable.Fields[idx_FabricantesID].AsInteger;
end;
procedure TFabricantesDataTableRules.SetIDValue(const aValue: Integer);
begin
DataTable.Fields[idx_FabricantesID].AsInteger := aValue;
end;
function TFabricantesDataTableRules.GetIDIsNull: boolean;
begin
result := DataTable.Fields[idx_FabricantesID].IsNull;
end;
procedure TFabricantesDataTableRules.SetIDIsNull(const aValue: Boolean);
begin
if aValue then
DataTable.Fields[idx_FabricantesID].AsVariant := Null;
end;
function TFabricantesDataTableRules.GetDESCRIPCIONValue: String;
begin
result := DataTable.Fields[idx_FabricantesDESCRIPCION].AsString;
end;
procedure TFabricantesDataTableRules.SetDESCRIPCIONValue(const aValue: String);
begin
DataTable.Fields[idx_FabricantesDESCRIPCION].AsString := aValue;
end;
function TFabricantesDataTableRules.GetDESCRIPCIONIsNull: boolean;
begin
result := DataTable.Fields[idx_FabricantesDESCRIPCION].IsNull;
end;
procedure TFabricantesDataTableRules.SetDESCRIPCIONIsNull(const aValue: Boolean);
begin
if aValue then
DataTable.Fields[idx_FabricantesDESCRIPCION].AsVariant := Null;
end;
initialization
RegisterDataTableRules(RID_Fabricantes, TFabricantesDataTableRules);
end.