unit schInformesServer_Intf;

interface

uses
  Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, schInformesClient_Intf;

const
  { Delta 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_InformesDelta = '{74CF2C20-601C-4EE4-BD37-D5BC5FA42F31}';

type
  { IInformesDelta }
  IInformesDelta = interface(IInformes)
  ['{74CF2C20-601C-4EE4-BD37-D5BC5FA42F31}']
    { Property getters and setters }
    function GetOldIDValue : Integer;
    function GetOldID_EMPRESAValue : Integer;
    function GetOldCATEGORIAValue : String;
    function GetOldCONTROLLERValue : String;
    function GetOldMODIFICABLEValue : String;
    function GetOldICONOValue : Integer;
    function GetOldNOMBREValue : String;
    function GetOldDESCRIPCIONValue : String;
    function GetOldORDENValue : Integer;
    function GetOldVISTAValue : IROStrings;

    { Properties }
    property OldID : Integer read GetOldIDValue;
    property OldID_EMPRESA : Integer read GetOldID_EMPRESAValue;
    property OldCATEGORIA : String read GetOldCATEGORIAValue;
    property OldCONTROLLER : String read GetOldCONTROLLERValue;
    property OldMODIFICABLE : String read GetOldMODIFICABLEValue;
    property OldICONO : Integer read GetOldICONOValue;
    property OldNOMBRE : String read GetOldNOMBREValue;
    property OldDESCRIPCION : String read GetOldDESCRIPCIONValue;
    property OldORDEN : Integer read GetOldORDENValue;
    property OldVISTA : IROStrings read GetOldVISTAValue;
  end;

  { TInformesBusinessProcessorRules }
  TInformesBusinessProcessorRules = class(TDABusinessProcessorRules, IInformes, IInformesDelta)
  private
  protected
    { Property getters and setters }
    function GetIDValue: Integer; virtual;
    function GetOldIDValue: Integer; virtual;
    procedure SetIDValue(const aValue: Integer); virtual;
    function GetID_EMPRESAValue: Integer; virtual;
    function GetOldID_EMPRESAValue: Integer; virtual;
    procedure SetID_EMPRESAValue(const aValue: Integer); virtual;
    function GetCATEGORIAValue: String; virtual;
    function GetOldCATEGORIAValue: String; virtual;
    procedure SetCATEGORIAValue(const aValue: String); virtual;
    function GetCONTROLLERValue: String; virtual;
    function GetOldCONTROLLERValue: String; virtual;
    procedure SetCONTROLLERValue(const aValue: String); virtual;
    function GetMODIFICABLEValue: String; virtual;
    function GetOldMODIFICABLEValue: String; virtual;
    procedure SetMODIFICABLEValue(const aValue: String); virtual;
    function GetICONOValue: Integer; virtual;
    function GetOldICONOValue: Integer; virtual;
    procedure SetICONOValue(const aValue: Integer); virtual;
    function GetNOMBREValue: String; virtual;
    function GetOldNOMBREValue: String; virtual;
    procedure SetNOMBREValue(const aValue: String); virtual;
    function GetDESCRIPCIONValue: String; virtual;
    function GetOldDESCRIPCIONValue: String; virtual;
    procedure SetDESCRIPCIONValue(const aValue: String); virtual;
    function GetORDENValue: Integer; virtual;
    function GetOldORDENValue: Integer; virtual;
    procedure SetORDENValue(const aValue: Integer); virtual;
    function GetVISTAValue: IROStrings; virtual;
    function GetOldVISTAValue: IROStrings; virtual;
    procedure SetVISTAValue(const aValue: IROStrings); virtual;

    { Properties }
    property ID : Integer read GetIDValue write SetIDValue;
    property OldID : Integer read GetOldIDValue;
    property ID_EMPRESA : Integer read GetID_EMPRESAValue write SetID_EMPRESAValue;
    property OldID_EMPRESA : Integer read GetOldID_EMPRESAValue;
    property CATEGORIA : String read GetCATEGORIAValue write SetCATEGORIAValue;
    property OldCATEGORIA : String read GetOldCATEGORIAValue;
    property CONTROLLER : String read GetCONTROLLERValue write SetCONTROLLERValue;
    property OldCONTROLLER : String read GetOldCONTROLLERValue;
    property MODIFICABLE : String read GetMODIFICABLEValue write SetMODIFICABLEValue;
    property OldMODIFICABLE : String read GetOldMODIFICABLEValue;
    property ICONO : Integer read GetICONOValue write SetICONOValue;
    property OldICONO : Integer read GetOldICONOValue;
    property NOMBRE : String read GetNOMBREValue write SetNOMBREValue;
    property OldNOMBRE : String read GetOldNOMBREValue;
    property DESCRIPCION : String read GetDESCRIPCIONValue write SetDESCRIPCIONValue;
    property OldDESCRIPCION : String read GetOldDESCRIPCIONValue;
    property ORDEN : Integer read GetORDENValue write SetORDENValue;
    property OldORDEN : Integer read GetOldORDENValue;
    property VISTA : IROStrings read GetVISTAValue write SetVISTAValue;
    property OldVISTA : IROStrings read GetOldVISTAValue;

  public
    constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
    destructor Destroy; override;

  end;

implementation

uses
  Variants, uROBinaryHelpers;

{ TInformesBusinessProcessorRules }
constructor TInformesBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin
  inherited;
end;

destructor TInformesBusinessProcessorRules.Destroy;
begin
  inherited;
end;

function TInformesBusinessProcessorRules.GetIDValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesID];
end;

function TInformesBusinessProcessorRules.GetOldIDValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesID];
end;

procedure TInformesBusinessProcessorRules.SetIDValue(const aValue: Integer);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesID] := aValue;
end;

function TInformesBusinessProcessorRules.GetID_EMPRESAValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesID_EMPRESA];
end;

function TInformesBusinessProcessorRules.GetOldID_EMPRESAValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesID_EMPRESA];
end;

procedure TInformesBusinessProcessorRules.SetID_EMPRESAValue(const aValue: Integer);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesID_EMPRESA] := aValue;
end;

function TInformesBusinessProcessorRules.GetCATEGORIAValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesCATEGORIA];
end;

function TInformesBusinessProcessorRules.GetOldCATEGORIAValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesCATEGORIA];
end;

procedure TInformesBusinessProcessorRules.SetCATEGORIAValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesCATEGORIA] := aValue;
end;

function TInformesBusinessProcessorRules.GetCONTROLLERValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesCONTROLLER];
end;

function TInformesBusinessProcessorRules.GetOldCONTROLLERValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesCONTROLLER];
end;

procedure TInformesBusinessProcessorRules.SetCONTROLLERValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesCONTROLLER] := aValue;
end;

function TInformesBusinessProcessorRules.GetMODIFICABLEValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesMODIFICABLE];
end;

function TInformesBusinessProcessorRules.GetOldMODIFICABLEValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesMODIFICABLE];
end;

procedure TInformesBusinessProcessorRules.SetMODIFICABLEValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesMODIFICABLE] := aValue;
end;

function TInformesBusinessProcessorRules.GetICONOValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesICONO];
end;

function TInformesBusinessProcessorRules.GetOldICONOValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesICONO];
end;

procedure TInformesBusinessProcessorRules.SetICONOValue(const aValue: Integer);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesICONO] := aValue;
end;

function TInformesBusinessProcessorRules.GetNOMBREValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesNOMBRE];
end;

function TInformesBusinessProcessorRules.GetOldNOMBREValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesNOMBRE];
end;

procedure TInformesBusinessProcessorRules.SetNOMBREValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesNOMBRE] := aValue;
end;

function TInformesBusinessProcessorRules.GetDESCRIPCIONValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesDESCRIPCION];
end;

function TInformesBusinessProcessorRules.GetOldDESCRIPCIONValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesDESCRIPCION];
end;

procedure TInformesBusinessProcessorRules.SetDESCRIPCIONValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesDESCRIPCION] := aValue;
end;

function TInformesBusinessProcessorRules.GetORDENValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesORDEN];
end;

function TInformesBusinessProcessorRules.GetOldORDENValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesORDEN];
end;

procedure TInformesBusinessProcessorRules.SetORDENValue(const aValue: Integer);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesORDEN] := aValue;
end;

function TInformesBusinessProcessorRules.GetVISTAValue: IROStrings;
begin
  result := NewROStrings();
  result.Text := BusinessProcessor.CurrentChange.NewValueByName[fld_InformesVISTA];
end;

function TInformesBusinessProcessorRules.GetOldVISTAValue: IROStrings;
begin
  result := NewROStrings();
  result.Text := BusinessProcessor.CurrentChange.OldValueByName[fld_InformesVISTA];
end;

procedure TInformesBusinessProcessorRules.SetVISTAValue(const aValue: IROStrings);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_InformesVISTA] := aValue.Text;
end;


initialization
  RegisterBusinessProcessorRules(RID_InformesDelta, TInformesBusinessProcessorRules);

end.
