unit schTiposVentaServer_Intf;

interface

uses
  Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, FmtBCD, uROXMLIntf, schTiposVentaClient_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_TiposVentaDelta = '{EE4200D0-8534-4896-8C5F-B34391984BD1}';

type
  { ITiposVentaDelta }
  ITiposVentaDelta = interface(ITiposVenta)
  ['{EE4200D0-8534-4896-8C5F-B34391984BD1}']
    { Property getters and setters }
    function GetOldIDValue : Integer;
    function GetOldDESCRIPCIONValue : String;
    function GetOldCODIGO_CONTABLEValue : String;

    { Properties }
    property OldID : Integer read GetOldIDValue;
    property OldDESCRIPCION : String read GetOldDESCRIPCIONValue;
    property OldCODIGO_CONTABLE : String read GetOldCODIGO_CONTABLEValue;
  end;

  { TTiposVentaBusinessProcessorRules }
  TTiposVentaBusinessProcessorRules = class(TDABusinessProcessorRules, ITiposVenta, ITiposVentaDelta)
  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 GetDESCRIPCIONValue: String; virtual;
    function GetDESCRIPCIONIsNull: Boolean; virtual;
    function GetOldDESCRIPCIONValue: String; virtual;
    function GetOldDESCRIPCIONIsNull: Boolean; virtual;
    procedure SetDESCRIPCIONValue(const aValue: String); virtual;
    procedure SetDESCRIPCIONIsNull(const aValue: Boolean); virtual;
    function GetCODIGO_CONTABLEValue: String; virtual;
    function GetCODIGO_CONTABLEIsNull: Boolean; virtual;
    function GetOldCODIGO_CONTABLEValue: String; virtual;
    function GetOldCODIGO_CONTABLEIsNull: Boolean; virtual;
    procedure SetCODIGO_CONTABLEValue(const aValue: String); virtual;
    procedure SetCODIGO_CONTABLEIsNull(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 DESCRIPCION : String read GetDESCRIPCIONValue write SetDESCRIPCIONValue;
    property DESCRIPCIONIsNull : Boolean read GetDESCRIPCIONIsNull write SetDESCRIPCIONIsNull;
    property OldDESCRIPCION : String read GetOldDESCRIPCIONValue;
    property OldDESCRIPCIONIsNull : Boolean read GetOldDESCRIPCIONIsNull;
    property CODIGO_CONTABLE : String read GetCODIGO_CONTABLEValue write SetCODIGO_CONTABLEValue;
    property CODIGO_CONTABLEIsNull : Boolean read GetCODIGO_CONTABLEIsNull write SetCODIGO_CONTABLEIsNull;
    property OldCODIGO_CONTABLE : String read GetOldCODIGO_CONTABLEValue;
    property OldCODIGO_CONTABLEIsNull : Boolean read GetOldCODIGO_CONTABLEIsNull;

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

  end;

implementation

uses
  Variants, uROBinaryHelpers, uDAInterfaces;

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

destructor TTiposVentaBusinessProcessorRules.Destroy;
begin
  inherited;
end;

function TTiposVentaBusinessProcessorRules.GetIDValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_TiposVentaID];
end;

function TTiposVentaBusinessProcessorRules.GetIDIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_TiposVentaID]);
end;

function TTiposVentaBusinessProcessorRules.GetOldIDValue: Integer;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_TiposVentaID];
end;

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

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

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

function TTiposVentaBusinessProcessorRules.GetDESCRIPCIONValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_TiposVentaDESCRIPCION];
end;

function TTiposVentaBusinessProcessorRules.GetDESCRIPCIONIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_TiposVentaDESCRIPCION]);
end;

function TTiposVentaBusinessProcessorRules.GetOldDESCRIPCIONValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_TiposVentaDESCRIPCION];
end;

function TTiposVentaBusinessProcessorRules.GetOldDESCRIPCIONIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_TiposVentaDESCRIPCION]);
end;

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

procedure TTiposVentaBusinessProcessorRules.SetDESCRIPCIONIsNull(const aValue: Boolean);
begin
  if aValue then
    BusinessProcessor.CurrentChange.NewValueByName[fld_TiposVentaDESCRIPCION] := Null;
end;

function TTiposVentaBusinessProcessorRules.GetCODIGO_CONTABLEValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_TiposVentaCODIGO_CONTABLE];
end;

function TTiposVentaBusinessProcessorRules.GetCODIGO_CONTABLEIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_TiposVentaCODIGO_CONTABLE]);
end;

function TTiposVentaBusinessProcessorRules.GetOldCODIGO_CONTABLEValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_TiposVentaCODIGO_CONTABLE];
end;

function TTiposVentaBusinessProcessorRules.GetOldCODIGO_CONTABLEIsNull: Boolean;
begin
  result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_TiposVentaCODIGO_CONTABLE]);
end;

procedure TTiposVentaBusinessProcessorRules.SetCODIGO_CONTABLEValue(const aValue: String);
begin
  BusinessProcessor.CurrentChange.NewValueByName[fld_TiposVentaCODIGO_CONTABLE] := aValue;
end;

procedure TTiposVentaBusinessProcessorRules.SetCODIGO_CONTABLEIsNull(const aValue: Boolean);
begin
  if aValue then
    BusinessProcessor.CurrentChange.NewValueByName[fld_TiposVentaCODIGO_CONTABLE] := Null;
end;


initialization
  RegisterBusinessProcessorRules(RID_TiposVentaDelta, TTiposVentaBusinessProcessorRules);

end.
