unit schImpresionesServer_Intf;

interface

uses
  Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, FmtBCD, uROXMLIntf, 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 = '{39C9B388-CB4D-4288-9919-83D9F9D40263}';

type
  { IImpresionesDelta }
  IImpresionesDelta = interface(IImpresiones)
  ['{39C9B388-CB4D-4288-9919-83D9F9D40263}']
    { 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 GetIDIsNull: Boolean; virtual;
    function GetOldIDValue: Integer; virtual;
    function GetOldIDIsNull: Boolean; virtual;
    procedure SetIDValue(const aValue: Integer); virtual;
    procedure SetIDIsNull(const aValue: Boolean); virtual;
    function GetTABLAValue: String; virtual;
    function GetTABLAIsNull: Boolean; virtual;
    function GetOldTABLAValue: String; virtual;
    function GetOldTABLAIsNull: Boolean; virtual;
    procedure SetTABLAValue(const aValue: String); virtual;
    procedure SetTABLAIsNull(const aValue: Boolean); virtual;
    function GetID_TABLAValue: Integer; virtual;
    function GetID_TABLAIsNull: Boolean; virtual;
    function GetOldID_TABLAValue: Integer; virtual;
    function GetOldID_TABLAIsNull: Boolean; virtual;
    procedure SetID_TABLAValue(const aValue: Integer); virtual;
    procedure SetID_TABLAIsNull(const aValue: Boolean); virtual;
    function GetNUM_COPIASValue: Integer; virtual;
    function GetNUM_COPIASIsNull: Boolean; virtual;
    function GetOldNUM_COPIASValue: Integer; virtual;
    function GetOldNUM_COPIASIsNull: Boolean; virtual;
    procedure SetNUM_COPIASValue(const aValue: Integer); virtual;
    procedure SetNUM_COPIASIsNull(const aValue: Boolean); virtual;

    { Properties }
    property ID : Integer read GetIDValue write SetIDValue;
    property IDIsNull : Boolean read GetIDIsNull write SetIDIsNull;
    property OldID : Integer read GetOldIDValue;
    property OldIDIsNull : Boolean read GetOldIDIsNull;
    property TABLA : String read GetTABLAValue write SetTABLAValue;
    property TABLAIsNull : Boolean read GetTABLAIsNull write SetTABLAIsNull;
    property OldTABLA : String read GetOldTABLAValue;
    property OldTABLAIsNull : Boolean read GetOldTABLAIsNull;
    property ID_TABLA : Integer read GetID_TABLAValue write SetID_TABLAValue;
    property ID_TABLAIsNull : Boolean read GetID_TABLAIsNull write SetID_TABLAIsNull;
    property OldID_TABLA : Integer read GetOldID_TABLAValue;
    property OldID_TABLAIsNull : Boolean read GetOldID_TABLAIsNull;
    property NUM_COPIAS : Integer read GetNUM_COPIASValue write SetNUM_COPIASValue;
    property NUM_COPIASIsNull : Boolean read GetNUM_COPIASIsNull write SetNUM_COPIASIsNull;
    property OldNUM_COPIAS : Integer read GetOldNUM_COPIASValue;
    property OldNUM_COPIASIsNull : Boolean read GetOldNUM_COPIASIsNull;

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

  end;

implementation

uses
  Variants, uROBinaryHelpers, uDAInterfaces;

{ 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.GetIDIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID]);
end;

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

function TImpresionesBusinessProcessorRules.GetOldIDIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesID]);
end;

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

procedure TImpresionesBusinessProcessorRules.SetIDIsNull(const aValue: Boolean);
begin
  if aValue then
    BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID] := Null;
end;

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

function TImpresionesBusinessProcessorRules.GetTABLAIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesTABLA]);
end;

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

function TImpresionesBusinessProcessorRules.GetOldTABLAIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesTABLA]);
end;

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

procedure TImpresionesBusinessProcessorRules.SetTABLAIsNull(const aValue: Boolean);
begin
  if aValue then
    BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesTABLA] := Null;
end;

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

function TImpresionesBusinessProcessorRules.GetID_TABLAIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID_TABLA]);
end;

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

function TImpresionesBusinessProcessorRules.GetOldID_TABLAIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesID_TABLA]);
end;

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

procedure TImpresionesBusinessProcessorRules.SetID_TABLAIsNull(const aValue: Boolean);
begin
  if aValue then
    BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID_TABLA] := Null;
end;

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

function TImpresionesBusinessProcessorRules.GetNUM_COPIASIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesNUM_COPIAS]);
end;

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

function TImpresionesBusinessProcessorRules.GetOldNUM_COPIASIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesNUM_COPIAS]);
end;

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

procedure TImpresionesBusinessProcessorRules.SetNUM_COPIASIsNull(const aValue: Boolean);
begin
  if aValue then
    BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesNUM_COPIAS] := Null;
end;


initialization
  RegisterBusinessProcessorRules(RID_ImpresionesDelta, TImpresionesBusinessProcessorRules);

end.
