unit schFamiliasServer_Intf;

interface

uses
  Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, schFamiliasClient_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_FamiliasDelta = '{7935CA4C-99B8-4F96-A8CD-3CE4BCCFC041}';

type
  { IFamiliasDelta }
  IFamiliasDelta = interface(IFamilias)
  ['{7935CA4C-99B8-4F96-A8CD-3CE4BCCFC041}']
    { Property getters and setters }
    function GetOldDESCRIPCIONValue : String;

    { Properties }
    property OldDESCRIPCION : String read GetOldDESCRIPCIONValue;
  end;

  { TFamiliasBusinessProcessorRules }
  TFamiliasBusinessProcessorRules = class(TDABusinessProcessorRules, IFamilias, IFamiliasDelta)
  private
  protected
    { Property getters and setters }
    function GetDESCRIPCIONValue: String; virtual;
    function GetOldDESCRIPCIONValue: String; virtual;
    procedure SetDESCRIPCIONValue(const aValue: String); virtual;

    { Properties }
    property DESCRIPCION : String read GetDESCRIPCIONValue write SetDESCRIPCIONValue;
    property OldDESCRIPCION : String read GetOldDESCRIPCIONValue;

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

  end;

implementation

uses
  Variants, uROBinaryHelpers;

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

destructor TFamiliasBusinessProcessorRules.Destroy;
begin
  inherited;
end;

function TFamiliasBusinessProcessorRules.GetDESCRIPCIONValue: String;
begin
  result := BusinessProcessor.CurrentChange.NewValueByName[fld_FamiliasDESCRIPCION];
end;

function TFamiliasBusinessProcessorRules.GetOldDESCRIPCIONValue: String;
begin
  result := BusinessProcessor.CurrentChange.OldValueByName[fld_FamiliasDESCRIPCION];
end;

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


initialization
  RegisterBusinessProcessorRules(RID_FamiliasDelta, TFamiliasBusinessProcessorRules);

end.
