unit schImpresionesServer_Intf;

interface

uses
  Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, schImpresionesClient_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_ImpresionesDelta = '{2013D757-4089-4550-B61B-481831BE4EF9}';

type
  { IImpresionesDelta }
  IImpresionesDelta = interface(IImpresiones)
  ['{2013D757-4089-4550-B61B-481831BE4EF9}']
    { Property getters and setters }
    function GetOldIDValue : Integer;
    function GetOldTABLAValue : String;
    function GetOldID_TABLAValue : Integer;
    function GetOldNUM_COPIASValue : Integer;

    { Properties }
    property OldID : Integer read GetOldIDValue;
    property OldTABLA : String read GetOldTABLAValue;
    property OldID_TABLA : Integer read GetOldID_TABLAValue;
    property OldNUM_COPIAS : Integer read GetOldNUM_COPIASValue;
  end;

  { TImpresionesBusinessProcessorRules }
  TImpresionesBusinessProcessorRules = class(TDABusinessProcessorRules, IImpresiones, IImpresionesDelta)
  private
  protected
    { Property getters and setters }
    function GetIDValue: Integer; virtual;
    function GetOldIDValue: Integer; virtual;
    procedure SetIDValue(const aValue: Integer); virtual;
    function GetTABLAValue: String; virtual;
    function GetOldTABLAValue: String; virtual;
    procedure SetTABLAValue(const aValue: String); virtual;
    function GetID_TABLAValue: Integer; virtual;
    function GetOldID_TABLAValue: Integer; virtual;
    procedure SetID_TABLAValue(const aValue: Integer); virtual;
    function GetNUM_COPIASValue: Integer; virtual;
    function GetOldNUM_COPIASValue: Integer; virtual;
    procedure SetNUM_COPIASValue(const aValue: Integer); virtual;

    { Properties }
    property ID : Integer read GetIDValue write SetIDValue;
    property OldID : Integer read GetOldIDValue;
    property TABLA : String read GetTABLAValue write SetTABLAValue;
    property OldTABLA : String read GetOldTABLAValue;
    property ID_TABLA : Integer read GetID_TABLAValue write SetID_TABLAValue;
    property OldID_TABLA : Integer read GetOldID_TABLAValue;
    property NUM_COPIAS : Integer read GetNUM_COPIASValue write SetNUM_COPIASValue;
    property OldNUM_COPIAS : Integer read GetOldNUM_COPIASValue;

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

  end;

implementation

uses
  Variants, uROBinaryHelpers;

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

destructor TImpresionesBusinessProcessorRules.Destroy;
begin
  inherited;
end;

function TImpresionesBusinessProcessorRules.GetIDValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID];
end;

function TImpresionesBusinessProcessorRules.GetOldIDValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesID];
end;

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

function TImpresionesBusinessProcessorRules.GetTABLAValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesTABLA];
end;

function TImpresionesBusinessProcessorRules.GetOldTABLAValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesTABLA];
end;

procedure TImpresionesBusinessProcessorRules.SetTABLAValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesTABLA] := aValue;
end;

function TImpresionesBusinessProcessorRules.GetID_TABLAValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID_TABLA];
end;

function TImpresionesBusinessProcessorRules.GetOldID_TABLAValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesID_TABLA];
end;

procedure TImpresionesBusinessProcessorRules.SetID_TABLAValue(const aValue: Integer);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID_TABLA] := aValue;
end;

function TImpresionesBusinessProcessorRules.GetNUM_COPIASValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesNUM_COPIAS];
end;

function TImpresionesBusinessProcessorRules.GetOldNUM_COPIASValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesNUM_COPIAS];
end;

procedure TImpresionesBusinessProcessorRules.SetNUM_COPIASValue(const aValue: Integer);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesNUM_COPIAS] := aValue;
end;


initialization
  RegisterBusinessProcessorRules(RID_ImpresionesDelta, TImpresionesBusinessProcessorRules);

end.
