unit schComisionesServer_Intf; interface uses Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, schComisionesClient_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_ALBARANESCOMISIONDelta = '{723E463B-BFA7-45DB-8FA7-98CDAE8AE108}'; RID_VENDEDORESCOMISIONDelta = '{7638AD2A-3961-4F94-9B41-EDC5BA62D8CE}'; RID_COMISIONESDelta = '{5CE2427D-5EE2-41E3-9923-6462FE360202}'; type { IALBARANESCOMISIONDelta } IALBARANESCOMISIONDelta = interface(IALBARANESCOMISION) ['{723E463B-BFA7-45DB-8FA7-98CDAE8AE108}'] { Property getters and setters } function GetOldSELECCIONValue : Integer; function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOValue : Integer; function GetOldREFERENCIAValue : String; function GetOldCODIGOCONTACTOValue : Integer; function GetOldNOMBREValue : String; function GetOldFECHAALBARANValue : DateTime; function GetOldSITUACIONValue : String; function GetOldFECHAPAGOValue : DateTime; function GetOldIMPORTETOTALValue : Currency; function GetOldCODIGOPRESUPUESTOValue : Integer; function GetOldREFERENCIAPRESUPUESTOValue : String; { Properties } property OldSELECCION : Integer read GetOldSELECCIONValue; property OldCODIGOEMPRESA : Integer read GetOldCODIGOEMPRESAValue; property OldCODIGO : Integer read GetOldCODIGOValue; property OldREFERENCIA : String read GetOldREFERENCIAValue; property OldCODIGOCONTACTO : Integer read GetOldCODIGOCONTACTOValue; property OldNOMBRE : String read GetOldNOMBREValue; property OldFECHAALBARAN : DateTime read GetOldFECHAALBARANValue; property OldSITUACION : String read GetOldSITUACIONValue; property OldFECHAPAGO : DateTime read GetOldFECHAPAGOValue; property OldIMPORTETOTAL : Currency read GetOldIMPORTETOTALValue; property OldCODIGOPRESUPUESTO : Integer read GetOldCODIGOPRESUPUESTOValue; property OldREFERENCIAPRESUPUESTO : String read GetOldREFERENCIAPRESUPUESTOValue; end; { TALBARANESCOMISIONBusinessProcessorRules } TALBARANESCOMISIONBusinessProcessorRules = class(TDABusinessProcessorRules, IALBARANESCOMISION, IALBARANESCOMISIONDelta) private protected { Property getters and setters } function GetSELECCIONValue: Integer; virtual; function GetOldSELECCIONValue: Integer; virtual; procedure SetSELECCIONValue(const aValue: Integer); virtual; function GetCODIGOEMPRESAValue: Integer; virtual; function GetOldCODIGOEMPRESAValue: Integer; virtual; procedure SetCODIGOEMPRESAValue(const aValue: Integer); virtual; function GetCODIGOValue: Integer; virtual; function GetOldCODIGOValue: Integer; virtual; procedure SetCODIGOValue(const aValue: Integer); virtual; function GetREFERENCIAValue: String; virtual; function GetOldREFERENCIAValue: String; virtual; procedure SetREFERENCIAValue(const aValue: String); virtual; function GetCODIGOCONTACTOValue: Integer; virtual; function GetOldCODIGOCONTACTOValue: Integer; virtual; procedure SetCODIGOCONTACTOValue(const aValue: Integer); virtual; function GetNOMBREValue: String; virtual; function GetOldNOMBREValue: String; virtual; procedure SetNOMBREValue(const aValue: String); virtual; function GetFECHAALBARANValue: DateTime; virtual; function GetOldFECHAALBARANValue: DateTime; virtual; procedure SetFECHAALBARANValue(const aValue: DateTime); virtual; function GetSITUACIONValue: String; virtual; function GetOldSITUACIONValue: String; virtual; procedure SetSITUACIONValue(const aValue: String); virtual; function GetFECHAPAGOValue: DateTime; virtual; function GetOldFECHAPAGOValue: DateTime; virtual; procedure SetFECHAPAGOValue(const aValue: DateTime); virtual; function GetIMPORTETOTALValue: Currency; virtual; function GetOldIMPORTETOTALValue: Currency; virtual; procedure SetIMPORTETOTALValue(const aValue: Currency); virtual; function GetCODIGOPRESUPUESTOValue: Integer; virtual; function GetOldCODIGOPRESUPUESTOValue: Integer; virtual; procedure SetCODIGOPRESUPUESTOValue(const aValue: Integer); virtual; function GetREFERENCIAPRESUPUESTOValue: String; virtual; function GetOldREFERENCIAPRESUPUESTOValue: String; virtual; procedure SetREFERENCIAPRESUPUESTOValue(const aValue: String); virtual; { Properties } property SELECCION : Integer read GetSELECCIONValue write SetSELECCIONValue; property OldSELECCION : Integer read GetOldSELECCIONValue; property CODIGOEMPRESA : Integer read GetCODIGOEMPRESAValue write SetCODIGOEMPRESAValue; property OldCODIGOEMPRESA : Integer read GetOldCODIGOEMPRESAValue; property CODIGO : Integer read GetCODIGOValue write SetCODIGOValue; property OldCODIGO : Integer read GetOldCODIGOValue; property REFERENCIA : String read GetREFERENCIAValue write SetREFERENCIAValue; property OldREFERENCIA : String read GetOldREFERENCIAValue; property CODIGOCONTACTO : Integer read GetCODIGOCONTACTOValue write SetCODIGOCONTACTOValue; property OldCODIGOCONTACTO : Integer read GetOldCODIGOCONTACTOValue; property NOMBRE : String read GetNOMBREValue write SetNOMBREValue; property OldNOMBRE : String read GetOldNOMBREValue; property FECHAALBARAN : DateTime read GetFECHAALBARANValue write SetFECHAALBARANValue; property OldFECHAALBARAN : DateTime read GetOldFECHAALBARANValue; property SITUACION : String read GetSITUACIONValue write SetSITUACIONValue; property OldSITUACION : String read GetOldSITUACIONValue; property FECHAPAGO : DateTime read GetFECHAPAGOValue write SetFECHAPAGOValue; property OldFECHAPAGO : DateTime read GetOldFECHAPAGOValue; property IMPORTETOTAL : Currency read GetIMPORTETOTALValue write SetIMPORTETOTALValue; property OldIMPORTETOTAL : Currency read GetOldIMPORTETOTALValue; property CODIGOPRESUPUESTO : Integer read GetCODIGOPRESUPUESTOValue write SetCODIGOPRESUPUESTOValue; property OldCODIGOPRESUPUESTO : Integer read GetOldCODIGOPRESUPUESTOValue; property REFERENCIAPRESUPUESTO : String read GetREFERENCIAPRESUPUESTOValue write SetREFERENCIAPRESUPUESTOValue; property OldREFERENCIAPRESUPUESTO : String read GetOldREFERENCIAPRESUPUESTOValue; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; destructor Destroy; override; end; { IVENDEDORESCOMISIONDelta } IVENDEDORESCOMISIONDelta = interface(IVENDEDORESCOMISION) ['{7638AD2A-3961-4F94-9B41-EDC5BA62D8CE}'] { Property getters and setters } function GetOldVENDEDORValue : String; function GetOldPORCENTAJEValue : Float; function GetOldCOMISIONValue : Float; { Properties } property OldVENDEDOR : String read GetOldVENDEDORValue; property OldPORCENTAJE : Float read GetOldPORCENTAJEValue; property OldCOMISION : Float read GetOldCOMISIONValue; end; { TVENDEDORESCOMISIONBusinessProcessorRules } TVENDEDORESCOMISIONBusinessProcessorRules = class(TDABusinessProcessorRules, IVENDEDORESCOMISION, IVENDEDORESCOMISIONDelta) private protected { Property getters and setters } function GetVENDEDORValue: String; virtual; function GetOldVENDEDORValue: String; virtual; procedure SetVENDEDORValue(const aValue: String); virtual; function GetPORCENTAJEValue: Float; virtual; function GetOldPORCENTAJEValue: Float; virtual; procedure SetPORCENTAJEValue(const aValue: Float); virtual; function GetCOMISIONValue: Float; virtual; function GetOldCOMISIONValue: Float; virtual; procedure SetCOMISIONValue(const aValue: Float); virtual; { Properties } property VENDEDOR : String read GetVENDEDORValue write SetVENDEDORValue; property OldVENDEDOR : String read GetOldVENDEDORValue; property PORCENTAJE : Float read GetPORCENTAJEValue write SetPORCENTAJEValue; property OldPORCENTAJE : Float read GetOldPORCENTAJEValue; property COMISION : Float read GetCOMISIONValue write SetCOMISIONValue; property OldCOMISION : Float read GetOldCOMISIONValue; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; destructor Destroy; override; end; { ICOMISIONESDelta } ICOMISIONESDelta = interface(ICOMISIONES) ['{5CE2427D-5EE2-41E3-9923-6462FE360202}'] { Property getters and setters } function GetOldCOMISIONValue : Float; { Properties } property OldCOMISION : Float read GetOldCOMISIONValue; end; { TCOMISIONESBusinessProcessorRules } TCOMISIONESBusinessProcessorRules = class(TDABusinessProcessorRules, ICOMISIONES, ICOMISIONESDelta) private protected { Property getters and setters } function GetCOMISIONValue: Float; virtual; function GetOldCOMISIONValue: Float; virtual; procedure SetCOMISIONValue(const aValue: Float); virtual; { Properties } property COMISION : Float read GetCOMISIONValue write SetCOMISIONValue; property OldCOMISION : Float read GetOldCOMISIONValue; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; destructor Destroy; override; end; implementation uses Variants, uROBinaryHelpers; { TALBARANESCOMISIONBusinessProcessorRules } constructor TALBARANESCOMISIONBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); begin inherited; end; destructor TALBARANESCOMISIONBusinessProcessorRules.Destroy; begin inherited; end; function TALBARANESCOMISIONBusinessProcessorRules.GetSELECCIONValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONSELECCION]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldSELECCIONValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONSELECCION]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetSELECCIONValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONSELECCION] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetCODIGOEMPRESAValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONCODIGOEMPRESA]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldCODIGOEMPRESAValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONCODIGOEMPRESA]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetCODIGOEMPRESAValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONCODIGOEMPRESA] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetCODIGOValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONCODIGO]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldCODIGOValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONCODIGO]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetCODIGOValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONCODIGO] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetREFERENCIAValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONREFERENCIA]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldREFERENCIAValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONREFERENCIA]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetREFERENCIAValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONREFERENCIA] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetCODIGOCONTACTOValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONCODIGOCONTACTO]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldCODIGOCONTACTOValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONCODIGOCONTACTO]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetCODIGOCONTACTOValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONCODIGOCONTACTO] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetNOMBREValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONNOMBRE]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldNOMBREValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONNOMBRE]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetNOMBREValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONNOMBRE] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetFECHAALBARANValue: DateTime; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONFECHAALBARAN]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldFECHAALBARANValue: DateTime; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONFECHAALBARAN]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetFECHAALBARANValue(const aValue: DateTime); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONFECHAALBARAN] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetSITUACIONValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONSITUACION]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldSITUACIONValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONSITUACION]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetSITUACIONValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONSITUACION] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetFECHAPAGOValue: DateTime; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONFECHAPAGO]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldFECHAPAGOValue: DateTime; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONFECHAPAGO]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetFECHAPAGOValue(const aValue: DateTime); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONFECHAPAGO] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetIMPORTETOTALValue: Currency; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONIMPORTETOTAL]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldIMPORTETOTALValue: Currency; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONIMPORTETOTAL]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetIMPORTETOTALValue(const aValue: Currency); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONIMPORTETOTAL] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetCODIGOPRESUPUESTOValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONCODIGOPRESUPUESTO]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldCODIGOPRESUPUESTOValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONCODIGOPRESUPUESTO]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetCODIGOPRESUPUESTOValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONCODIGOPRESUPUESTO] := aValue; end; function TALBARANESCOMISIONBusinessProcessorRules.GetREFERENCIAPRESUPUESTOValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONREFERENCIAPRESUPUESTO]; end; function TALBARANESCOMISIONBusinessProcessorRules.GetOldREFERENCIAPRESUPUESTOValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_ALBARANESCOMISIONREFERENCIAPRESUPUESTO]; end; procedure TALBARANESCOMISIONBusinessProcessorRules.SetREFERENCIAPRESUPUESTOValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_ALBARANESCOMISIONREFERENCIAPRESUPUESTO] := aValue; end; { TVENDEDORESCOMISIONBusinessProcessorRules } constructor TVENDEDORESCOMISIONBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); begin inherited; end; destructor TVENDEDORESCOMISIONBusinessProcessorRules.Destroy; begin inherited; end; function TVENDEDORESCOMISIONBusinessProcessorRules.GetVENDEDORValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_VENDEDORESCOMISIONVENDEDOR]; end; function TVENDEDORESCOMISIONBusinessProcessorRules.GetOldVENDEDORValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_VENDEDORESCOMISIONVENDEDOR]; end; procedure TVENDEDORESCOMISIONBusinessProcessorRules.SetVENDEDORValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_VENDEDORESCOMISIONVENDEDOR] := aValue; end; function TVENDEDORESCOMISIONBusinessProcessorRules.GetPORCENTAJEValue: Float; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_VENDEDORESCOMISIONPORCENTAJE]; end; function TVENDEDORESCOMISIONBusinessProcessorRules.GetOldPORCENTAJEValue: Float; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_VENDEDORESCOMISIONPORCENTAJE]; end; procedure TVENDEDORESCOMISIONBusinessProcessorRules.SetPORCENTAJEValue(const aValue: Float); begin BusinessProcessor.CurrentChange.NewValueByName[fld_VENDEDORESCOMISIONPORCENTAJE] := aValue; end; function TVENDEDORESCOMISIONBusinessProcessorRules.GetCOMISIONValue: Float; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_VENDEDORESCOMISIONCOMISION]; end; function TVENDEDORESCOMISIONBusinessProcessorRules.GetOldCOMISIONValue: Float; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_VENDEDORESCOMISIONCOMISION]; end; procedure TVENDEDORESCOMISIONBusinessProcessorRules.SetCOMISIONValue(const aValue: Float); begin BusinessProcessor.CurrentChange.NewValueByName[fld_VENDEDORESCOMISIONCOMISION] := aValue; end; { TCOMISIONESBusinessProcessorRules } constructor TCOMISIONESBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); begin inherited; end; destructor TCOMISIONESBusinessProcessorRules.Destroy; begin inherited; end; function TCOMISIONESBusinessProcessorRules.GetCOMISIONValue: Float; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COMISIONESCOMISION]; end; function TCOMISIONESBusinessProcessorRules.GetOldCOMISIONValue: Float; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COMISIONESCOMISION]; end; procedure TCOMISIONESBusinessProcessorRules.SetCOMISIONValue(const aValue: Float); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COMISIONESCOMISION] := aValue; end; initialization RegisterBusinessProcessorRules(RID_ALBARANESCOMISIONDelta, TALBARANESCOMISIONBusinessProcessorRules); RegisterBusinessProcessorRules(RID_VENDEDORESCOMISIONDelta, TVENDEDORESCOMISIONBusinessProcessorRules); RegisterBusinessProcessorRules(RID_COMISIONESDelta, TCOMISIONESBusinessProcessorRules); end.