unit schInformesClient_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_Informes = '{E7928EEC-E1CA-4117-AD71-651081CE43B0}';

  { Data table names }
  nme_Informes = 'Informes';

  { Informes fields }
  fld_InformesID = 'ID';
  fld_InformesID_EMPRESA = 'ID_EMPRESA';
  fld_InformesCATEGORIA = 'CATEGORIA';
  fld_InformesCONTROLLER = 'CONTROLLER';
  fld_InformesMODIFICABLE = 'MODIFICABLE';
  fld_InformesICONO = 'ICONO';
  fld_InformesNOMBRE = 'NOMBRE';
  fld_InformesDESCRIPCION = 'DESCRIPCION';
  fld_InformesORDEN = 'ORDEN';
  fld_InformesVISTA = 'VISTA';

  { Informes field indexes }
  idx_InformesID = 0;
  idx_InformesID_EMPRESA = 1;
  idx_InformesCATEGORIA = 2;
  idx_InformesCONTROLLER = 3;
  idx_InformesMODIFICABLE = 4;
  idx_InformesICONO = 5;
  idx_InformesNOMBRE = 6;
  idx_InformesDESCRIPCION = 7;
  idx_InformesORDEN = 8;
  idx_InformesVISTA = 9;

type
  { IInformes }
  IInformes = interface(IDAStronglyTypedDataTable)
  ['{FDC16F5A-3D0D-4100-BFD2-B28C537E5513}']
    { Property getters and setters }
    function GetIDValue: Integer;
    procedure SetIDValue(const aValue: Integer);
    function GetID_EMPRESAValue: Integer;
    procedure SetID_EMPRESAValue(const aValue: Integer);
    function GetCATEGORIAValue: String;
    procedure SetCATEGORIAValue(const aValue: String);
    function GetCONTROLLERValue: String;
    procedure SetCONTROLLERValue(const aValue: String);
    function GetMODIFICABLEValue: String;
    procedure SetMODIFICABLEValue(const aValue: String);
    function GetICONOValue: Integer;
    procedure SetICONOValue(const aValue: Integer);
    function GetNOMBREValue: String;
    procedure SetNOMBREValue(const aValue: String);
    function GetDESCRIPCIONValue: String;
    procedure SetDESCRIPCIONValue(const aValue: String);
    function GetORDENValue: Integer;
    procedure SetORDENValue(const aValue: Integer);
    function GetVISTAValue: IROStrings;
    procedure SetVISTAValue(const aValue: IROStrings);


    { Properties }
    property ID: Integer read GetIDValue write SetIDValue;
    property ID_EMPRESA: Integer read GetID_EMPRESAValue write SetID_EMPRESAValue;
    property CATEGORIA: String read GetCATEGORIAValue write SetCATEGORIAValue;
    property CONTROLLER: String read GetCONTROLLERValue write SetCONTROLLERValue;
    property MODIFICABLE: String read GetMODIFICABLEValue write SetMODIFICABLEValue;
    property ICONO: Integer read GetICONOValue write SetICONOValue;
    property NOMBRE: String read GetNOMBREValue write SetNOMBREValue;
    property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue;
    property ORDEN: Integer read GetORDENValue write SetORDENValue;
    property VISTA: IROStrings read GetVISTAValue write SetVISTAValue;
  end;

  { TInformesDataTableRules }
  TInformesDataTableRules = class(TDADataTableRules, IInformes)
  private
  protected
    { Property getters and setters }
    function GetIDValue: Integer; virtual;
    procedure SetIDValue(const aValue: Integer); virtual;
    function GetID_EMPRESAValue: Integer; virtual;
    procedure SetID_EMPRESAValue(const aValue: Integer); virtual;
    function GetCATEGORIAValue: String; virtual;
    procedure SetCATEGORIAValue(const aValue: String); virtual;
    function GetCONTROLLERValue: String; virtual;
    procedure SetCONTROLLERValue(const aValue: String); virtual;
    function GetMODIFICABLEValue: String; virtual;
    procedure SetMODIFICABLEValue(const aValue: String); virtual;
    function GetICONOValue: Integer; virtual;
    procedure SetICONOValue(const aValue: Integer); virtual;
    function GetNOMBREValue: String; virtual;
    procedure SetNOMBREValue(const aValue: String); virtual;
    function GetDESCRIPCIONValue: String; virtual;
    procedure SetDESCRIPCIONValue(const aValue: String); virtual;
    function GetORDENValue: Integer; virtual;
    procedure SetORDENValue(const aValue: Integer); virtual;
    function GetVISTAValue: IROStrings; virtual;
    procedure SetVISTAValue(const aValue: IROStrings); virtual;

    { Properties }
    property ID: Integer read GetIDValue write SetIDValue;
    property ID_EMPRESA: Integer read GetID_EMPRESAValue write SetID_EMPRESAValue;
    property CATEGORIA: String read GetCATEGORIAValue write SetCATEGORIAValue;
    property CONTROLLER: String read GetCONTROLLERValue write SetCONTROLLERValue;
    property MODIFICABLE: String read GetMODIFICABLEValue write SetMODIFICABLEValue;
    property ICONO: Integer read GetICONOValue write SetICONOValue;
    property NOMBRE: String read GetNOMBREValue write SetNOMBREValue;
    property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue;
    property ORDEN: Integer read GetORDENValue write SetORDENValue;
    property VISTA: IROStrings read GetVISTAValue write SetVISTAValue;

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

  end;

implementation

uses Variants;

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

destructor TInformesDataTableRules.Destroy;
begin
  inherited;
end;

function TInformesDataTableRules.GetIDValue: Integer;
begin
  result := DataTable.Fields[idx_InformesID].AsInteger;
end;

procedure TInformesDataTableRules.SetIDValue(const aValue: Integer);
begin
  DataTable.Fields[idx_InformesID].AsInteger := aValue;
end;

function TInformesDataTableRules.GetID_EMPRESAValue: Integer;
begin
  result := DataTable.Fields[idx_InformesID_EMPRESA].AsInteger;
end;

procedure TInformesDataTableRules.SetID_EMPRESAValue(const aValue: Integer);
begin
  DataTable.Fields[idx_InformesID_EMPRESA].AsInteger := aValue;
end;

function TInformesDataTableRules.GetCATEGORIAValue: String;
begin
  result := DataTable.Fields[idx_InformesCATEGORIA].AsString;
end;

procedure TInformesDataTableRules.SetCATEGORIAValue(const aValue: String);
begin
  DataTable.Fields[idx_InformesCATEGORIA].AsString := aValue;
end;

function TInformesDataTableRules.GetCONTROLLERValue: String;
begin
  result := DataTable.Fields[idx_InformesCONTROLLER].AsString;
end;

procedure TInformesDataTableRules.SetCONTROLLERValue(const aValue: String);
begin
  DataTable.Fields[idx_InformesCONTROLLER].AsString := aValue;
end;

function TInformesDataTableRules.GetMODIFICABLEValue: String;
begin
  result := DataTable.Fields[idx_InformesMODIFICABLE].AsString;
end;

procedure TInformesDataTableRules.SetMODIFICABLEValue(const aValue: String);
begin
  DataTable.Fields[idx_InformesMODIFICABLE].AsString := aValue;
end;

function TInformesDataTableRules.GetICONOValue: Integer;
begin
  result := DataTable.Fields[idx_InformesICONO].AsInteger;
end;

procedure TInformesDataTableRules.SetICONOValue(const aValue: Integer);
begin
  DataTable.Fields[idx_InformesICONO].AsInteger := aValue;
end;

function TInformesDataTableRules.GetNOMBREValue: String;
begin
  result := DataTable.Fields[idx_InformesNOMBRE].AsString;
end;

procedure TInformesDataTableRules.SetNOMBREValue(const aValue: String);
begin
  DataTable.Fields[idx_InformesNOMBRE].AsString := aValue;
end;

function TInformesDataTableRules.GetDESCRIPCIONValue: String;
begin
  result := DataTable.Fields[idx_InformesDESCRIPCION].AsString;
end;

procedure TInformesDataTableRules.SetDESCRIPCIONValue(const aValue: String);
begin
  DataTable.Fields[idx_InformesDESCRIPCION].AsString := aValue;
end;

function TInformesDataTableRules.GetORDENValue: Integer;
begin
  result := DataTable.Fields[idx_InformesORDEN].AsInteger;
end;

procedure TInformesDataTableRules.SetORDENValue(const aValue: Integer);
begin
  DataTable.Fields[idx_InformesORDEN].AsInteger := aValue;
end;

function TInformesDataTableRules.GetVISTAValue: IROStrings;
begin
  result := NewROStrings();
  result.Text := DataTable.Fields[idx_InformesVISTA].AsString;
end;

procedure TInformesDataTableRules.SetVISTAValue(const aValue: IROStrings);
begin
  DataTable.Fields[idx_InformesVISTA].AsString := aValue.Text;
end;


initialization
  RegisterDataTableRules(RID_Informes, TInformesDataTableRules);

end.
