unit schAlmacenesServer_Intf;

interface

uses
  Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, schAlmacenesClient_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_AlmacenesDelta = '{981232FA-466B-477F-9533-3B7C85B0502C}';

type
  { IAlmacenesDelta }
  IAlmacenesDelta = interface(IAlmacenes)
  ['{981232FA-466B-477F-9533-3B7C85B0502C}']
    { Property getters and setters }
    function GetOldIDValue : Integer;
    function GetOldID_EMPRESAValue : Integer;
    function GetOldFECHA_ALTAValue : DateTime;
    function GetOldCALLEValue : String;
    function GetOldPROVINCIAValue : String;
    function GetOldPOBLACIONValue : String;
    function GetOldCODIGO_POSTALValue : String;
    function GetOldTELEFONOValue : String;
    function GetOldMOVILValue : String;
    function GetOldFAXValue : String;
    function GetOldPERSONA_CONTACTOValue : String;
    function GetOldOBSERVACIONESValue : IROStrings;
    function GetOldFECHA_MODIFICACIONValue : DateTime;
    function GetOldUSUARIOValue : String;
    function GetOldNOMBREValue : String;

    { Properties }
    property OldID : Integer read GetOldIDValue;
    property OldID_EMPRESA : Integer read GetOldID_EMPRESAValue;
    property OldFECHA_ALTA : DateTime read GetOldFECHA_ALTAValue;
    property OldCALLE : String read GetOldCALLEValue;
    property OldPROVINCIA : String read GetOldPROVINCIAValue;
    property OldPOBLACION : String read GetOldPOBLACIONValue;
    property OldCODIGO_POSTAL : String read GetOldCODIGO_POSTALValue;
    property OldTELEFONO : String read GetOldTELEFONOValue;
    property OldMOVIL : String read GetOldMOVILValue;
    property OldFAX : String read GetOldFAXValue;
    property OldPERSONA_CONTACTO : String read GetOldPERSONA_CONTACTOValue;
    property OldOBSERVACIONES : IROStrings read GetOldOBSERVACIONESValue;
    property OldFECHA_MODIFICACION : DateTime read GetOldFECHA_MODIFICACIONValue;
    property OldUSUARIO : String read GetOldUSUARIOValue;
    property OldNOMBRE : String read GetOldNOMBREValue;
  end;

  { TAlmacenesBusinessProcessorRules }
  TAlmacenesBusinessProcessorRules = class(TDABusinessProcessorRules, IAlmacenes, IAlmacenesDelta)
  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 GetFECHA_ALTAValue: DateTime; virtual;
    function GetOldFECHA_ALTAValue: DateTime; virtual;
    procedure SetFECHA_ALTAValue(const aValue: DateTime); virtual;
    function GetCALLEValue: String; virtual;
    function GetOldCALLEValue: String; virtual;
    procedure SetCALLEValue(const aValue: String); virtual;
    function GetPROVINCIAValue: String; virtual;
    function GetOldPROVINCIAValue: String; virtual;
    procedure SetPROVINCIAValue(const aValue: String); virtual;
    function GetPOBLACIONValue: String; virtual;
    function GetOldPOBLACIONValue: String; virtual;
    procedure SetPOBLACIONValue(const aValue: String); virtual;
    function GetCODIGO_POSTALValue: String; virtual;
    function GetOldCODIGO_POSTALValue: String; virtual;
    procedure SetCODIGO_POSTALValue(const aValue: String); virtual;
    function GetTELEFONOValue: String; virtual;
    function GetOldTELEFONOValue: String; virtual;
    procedure SetTELEFONOValue(const aValue: String); virtual;
    function GetMOVILValue: String; virtual;
    function GetOldMOVILValue: String; virtual;
    procedure SetMOVILValue(const aValue: String); virtual;
    function GetFAXValue: String; virtual;
    function GetOldFAXValue: String; virtual;
    procedure SetFAXValue(const aValue: String); virtual;
    function GetPERSONA_CONTACTOValue: String; virtual;
    function GetOldPERSONA_CONTACTOValue: String; virtual;
    procedure SetPERSONA_CONTACTOValue(const aValue: String); virtual;
    function GetOBSERVACIONESValue: IROStrings; virtual;
    function GetOldOBSERVACIONESValue: IROStrings; virtual;
    procedure SetOBSERVACIONESValue(const aValue: IROStrings); virtual;
    function GetFECHA_MODIFICACIONValue: DateTime; virtual;
    function GetOldFECHA_MODIFICACIONValue: DateTime; virtual;
    procedure SetFECHA_MODIFICACIONValue(const aValue: DateTime); virtual;
    function GetUSUARIOValue: String; virtual;
    function GetOldUSUARIOValue: String; virtual;
    procedure SetUSUARIOValue(const aValue: String); virtual;
    function GetNOMBREValue: String; virtual;
    function GetOldNOMBREValue: String; virtual;
    procedure SetNOMBREValue(const aValue: String); 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 FECHA_ALTA : DateTime read GetFECHA_ALTAValue write SetFECHA_ALTAValue;
    property OldFECHA_ALTA : DateTime read GetOldFECHA_ALTAValue;
    property CALLE : String read GetCALLEValue write SetCALLEValue;
    property OldCALLE : String read GetOldCALLEValue;
    property PROVINCIA : String read GetPROVINCIAValue write SetPROVINCIAValue;
    property OldPROVINCIA : String read GetOldPROVINCIAValue;
    property POBLACION : String read GetPOBLACIONValue write SetPOBLACIONValue;
    property OldPOBLACION : String read GetOldPOBLACIONValue;
    property CODIGO_POSTAL : String read GetCODIGO_POSTALValue write SetCODIGO_POSTALValue;
    property OldCODIGO_POSTAL : String read GetOldCODIGO_POSTALValue;
    property TELEFONO : String read GetTELEFONOValue write SetTELEFONOValue;
    property OldTELEFONO : String read GetOldTELEFONOValue;
    property MOVIL : String read GetMOVILValue write SetMOVILValue;
    property OldMOVIL : String read GetOldMOVILValue;
    property FAX : String read GetFAXValue write SetFAXValue;
    property OldFAX : String read GetOldFAXValue;
    property PERSONA_CONTACTO : String read GetPERSONA_CONTACTOValue write SetPERSONA_CONTACTOValue;
    property OldPERSONA_CONTACTO : String read GetOldPERSONA_CONTACTOValue;
    property OBSERVACIONES : IROStrings read GetOBSERVACIONESValue write SetOBSERVACIONESValue;
    property OldOBSERVACIONES : IROStrings read GetOldOBSERVACIONESValue;
    property FECHA_MODIFICACION : DateTime read GetFECHA_MODIFICACIONValue write SetFECHA_MODIFICACIONValue;
    property OldFECHA_MODIFICACION : DateTime read GetOldFECHA_MODIFICACIONValue;
    property USUARIO : String read GetUSUARIOValue write SetUSUARIOValue;
    property OldUSUARIO : String read GetOldUSUARIOValue;
    property NOMBRE : String read GetNOMBREValue write SetNOMBREValue;
    property OldNOMBRE : String read GetOldNOMBREValue;

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

  end;

implementation

uses
  Variants, uROBinaryHelpers;

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

destructor TAlmacenesBusinessProcessorRules.Destroy;
begin
  inherited;
end;

function TAlmacenesBusinessProcessorRules.GetIDValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesID];
end;

function TAlmacenesBusinessProcessorRules.GetOldIDValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesID];
end;

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

function TAlmacenesBusinessProcessorRules.GetID_EMPRESAValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesID_EMPRESA];
end;

function TAlmacenesBusinessProcessorRules.GetOldID_EMPRESAValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesID_EMPRESA];
end;

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

function TAlmacenesBusinessProcessorRules.GetFECHA_ALTAValue: DateTime;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesFECHA_ALTA];
end;

function TAlmacenesBusinessProcessorRules.GetOldFECHA_ALTAValue: DateTime;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesFECHA_ALTA];
end;

procedure TAlmacenesBusinessProcessorRules.SetFECHA_ALTAValue(const aValue: DateTime);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesFECHA_ALTA] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetCALLEValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesCALLE];
end;

function TAlmacenesBusinessProcessorRules.GetOldCALLEValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesCALLE];
end;

procedure TAlmacenesBusinessProcessorRules.SetCALLEValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesCALLE] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetPROVINCIAValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesPROVINCIA];
end;

function TAlmacenesBusinessProcessorRules.GetOldPROVINCIAValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesPROVINCIA];
end;

procedure TAlmacenesBusinessProcessorRules.SetPROVINCIAValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesPROVINCIA] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetPOBLACIONValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesPOBLACION];
end;

function TAlmacenesBusinessProcessorRules.GetOldPOBLACIONValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesPOBLACION];
end;

procedure TAlmacenesBusinessProcessorRules.SetPOBLACIONValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesPOBLACION] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetCODIGO_POSTALValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesCODIGO_POSTAL];
end;

function TAlmacenesBusinessProcessorRules.GetOldCODIGO_POSTALValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesCODIGO_POSTAL];
end;

procedure TAlmacenesBusinessProcessorRules.SetCODIGO_POSTALValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesCODIGO_POSTAL] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetTELEFONOValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesTELEFONO];
end;

function TAlmacenesBusinessProcessorRules.GetOldTELEFONOValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesTELEFONO];
end;

procedure TAlmacenesBusinessProcessorRules.SetTELEFONOValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesTELEFONO] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetMOVILValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesMOVIL];
end;

function TAlmacenesBusinessProcessorRules.GetOldMOVILValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesMOVIL];
end;

procedure TAlmacenesBusinessProcessorRules.SetMOVILValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesMOVIL] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetFAXValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesFAX];
end;

function TAlmacenesBusinessProcessorRules.GetOldFAXValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesFAX];
end;

procedure TAlmacenesBusinessProcessorRules.SetFAXValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesFAX] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetPERSONA_CONTACTOValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesPERSONA_CONTACTO];
end;

function TAlmacenesBusinessProcessorRules.GetOldPERSONA_CONTACTOValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesPERSONA_CONTACTO];
end;

procedure TAlmacenesBusinessProcessorRules.SetPERSONA_CONTACTOValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesPERSONA_CONTACTO] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetOBSERVACIONESValue: IROStrings;
begin
  result := NewROStrings();
  result.Text := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesOBSERVACIONES];
end;

function TAlmacenesBusinessProcessorRules.GetOldOBSERVACIONESValue: IROStrings;
begin
  result := NewROStrings();
  result.Text := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesOBSERVACIONES];
end;

procedure TAlmacenesBusinessProcessorRules.SetOBSERVACIONESValue(const aValue: IROStrings);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesOBSERVACIONES] := aValue.Text;
end;

function TAlmacenesBusinessProcessorRules.GetFECHA_MODIFICACIONValue: DateTime;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesFECHA_MODIFICACION];
end;

function TAlmacenesBusinessProcessorRules.GetOldFECHA_MODIFICACIONValue: DateTime;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesFECHA_MODIFICACION];
end;

procedure TAlmacenesBusinessProcessorRules.SetFECHA_MODIFICACIONValue(const aValue: DateTime);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesFECHA_MODIFICACION] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetUSUARIOValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesUSUARIO];
end;

function TAlmacenesBusinessProcessorRules.GetOldUSUARIOValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesUSUARIO];
end;

procedure TAlmacenesBusinessProcessorRules.SetUSUARIOValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesUSUARIO] := aValue;
end;

function TAlmacenesBusinessProcessorRules.GetNOMBREValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_AlmacenesNOMBRE];
end;

function TAlmacenesBusinessProcessorRules.GetOldNOMBREValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_AlmacenesNOMBRE];
end;

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


initialization
  RegisterBusinessProcessorRules(RID_AlmacenesDelta, TAlmacenesBusinessProcessorRules);

end.
