unit schFamiliasClient_Intf;

interface

uses
  Classes, DB, SysUtils, uROClasses, uDADataTable;

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 = '{67A67A27-B0E7-4D8B-B283-A6A3B1BCF950}';

  { Data table names }
  nme_Familias = 'Familias';

  { Familias fields }
  fld_FamiliasDESCRIPCION = 'DESCRIPCION';

  { Familias field indexes }
  idx_FamiliasDESCRIPCION = 0;

type
  { IFamilias }
  IFamilias = interface(IDAStronglyTypedDataTable)
  ['{A882691E-EE02-4577-943E-E0EAE6291978}']
    { Property getters and setters }
    function GetDESCRIPCIONValue: String;
    procedure SetDESCRIPCIONValue(const aValue: String);


    { Properties }
    property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue;
  end;

  { TFamiliasDataTableRules }
  TFamiliasDataTableRules = class(TDADataTableRules, IFamilias)
  private
  protected
    { Property getters and setters }
    function GetDESCRIPCIONValue: String; virtual;
    procedure SetDESCRIPCIONValue(const aValue: String); virtual;

    { Properties }
    property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue;

  public
    constructor Create(aDataTable: TDADataTable); override;
    destructor Destroy; override;

  end;

implementation

uses Variants;

{ TFamiliasDataTableRules }
constructor TFamiliasDataTableRules.Create(aDataTable: TDADataTable);
begin
  inherited;
end;

destructor TFamiliasDataTableRules.Destroy;
begin
  inherited;
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;


initialization
  RegisterDataTableRules(RID_Familias, TFamiliasDataTableRules);

end.
