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_VENDEDORESCOMISIONDelta = '{AF94D568-59E7-44E9-9FDD-59EDEA47900F}'; RID_COMISIONESDelta = '{9705E926-9D16-4A15-A5F5-E33C2AB163C2}'; RID_COBROSCOMISIONDelta = '{9C3DE44E-1C94-4E84-A840-8855CEACFEEB}'; type { IVENDEDORESCOMISIONDelta } IVENDEDORESCOMISIONDelta = interface(IVENDEDORESCOMISION) ['{AF94D568-59E7-44E9-9FDD-59EDEA47900F}'] { 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) ['{9705E926-9D16-4A15-A5F5-E33C2AB163C2}'] { 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; { ICOBROSCOMISIONDelta } ICOBROSCOMISIONDelta = interface(ICOBROSCOMISION) ['{9C3DE44E-1C94-4E84-A840-8855CEACFEEB}'] { Property getters and setters } function GetOldSELECCIONValue : Integer; function GetOldCODIGOEMPRESAValue : Integer; function GetOldCODIGOValue : Integer; function GetOldCODIGOCONTACTOValue : Integer; function GetOldNOMBREValue : String; function GetOldFECHAPAGOValue : DateTime; function GetOldIMPORTEValue : Float; function GetOldFORMAPAGOValue : String; function GetOldDESCRIPCIONValue : String; function GetOldTIPOValue : String; function GetOldCODIGOCATEGORIAValue : Integer; function GetOldCATEGORIAValue : String; { Properties } property OldSELECCION : Integer read GetOldSELECCIONValue; property OldCODIGOEMPRESA : Integer read GetOldCODIGOEMPRESAValue; property OldCODIGO : Integer read GetOldCODIGOValue; property OldCODIGOCONTACTO : Integer read GetOldCODIGOCONTACTOValue; property OldNOMBRE : String read GetOldNOMBREValue; property OldFECHAPAGO : DateTime read GetOldFECHAPAGOValue; property OldIMPORTE : Float read GetOldIMPORTEValue; property OldFORMAPAGO : String read GetOldFORMAPAGOValue; property OldDESCRIPCION : String read GetOldDESCRIPCIONValue; property OldTIPO : String read GetOldTIPOValue; property OldCODIGOCATEGORIA : Integer read GetOldCODIGOCATEGORIAValue; property OldCATEGORIA : String read GetOldCATEGORIAValue; end; { TCOBROSCOMISIONBusinessProcessorRules } TCOBROSCOMISIONBusinessProcessorRules = class(TDABusinessProcessorRules, ICOBROSCOMISION, ICOBROSCOMISIONDelta) 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 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 GetFECHAPAGOValue: DateTime; virtual; function GetOldFECHAPAGOValue: DateTime; virtual; procedure SetFECHAPAGOValue(const aValue: DateTime); virtual; function GetIMPORTEValue: Float; virtual; function GetOldIMPORTEValue: Float; virtual; procedure SetIMPORTEValue(const aValue: Float); virtual; function GetFORMAPAGOValue: String; virtual; function GetOldFORMAPAGOValue: String; virtual; procedure SetFORMAPAGOValue(const aValue: String); virtual; function GetDESCRIPCIONValue: String; virtual; function GetOldDESCRIPCIONValue: String; virtual; procedure SetDESCRIPCIONValue(const aValue: String); virtual; function GetTIPOValue: String; virtual; function GetOldTIPOValue: String; virtual; procedure SetTIPOValue(const aValue: String); virtual; function GetCODIGOCATEGORIAValue: Integer; virtual; function GetOldCODIGOCATEGORIAValue: Integer; virtual; procedure SetCODIGOCATEGORIAValue(const aValue: Integer); virtual; function GetCATEGORIAValue: String; virtual; function GetOldCATEGORIAValue: String; virtual; procedure SetCATEGORIAValue(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 CODIGOCONTACTO : Integer read GetCODIGOCONTACTOValue write SetCODIGOCONTACTOValue; property OldCODIGOCONTACTO : Integer read GetOldCODIGOCONTACTOValue; property NOMBRE : String read GetNOMBREValue write SetNOMBREValue; property OldNOMBRE : String read GetOldNOMBREValue; property FECHAPAGO : DateTime read GetFECHAPAGOValue write SetFECHAPAGOValue; property OldFECHAPAGO : DateTime read GetOldFECHAPAGOValue; property IMPORTE : Float read GetIMPORTEValue write SetIMPORTEValue; property OldIMPORTE : Float read GetOldIMPORTEValue; property FORMAPAGO : String read GetFORMAPAGOValue write SetFORMAPAGOValue; property OldFORMAPAGO : String read GetOldFORMAPAGOValue; property DESCRIPCION : String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; property OldDESCRIPCION : String read GetOldDESCRIPCIONValue; property TIPO : String read GetTIPOValue write SetTIPOValue; property OldTIPO : String read GetOldTIPOValue; property CODIGOCATEGORIA : Integer read GetCODIGOCATEGORIAValue write SetCODIGOCATEGORIAValue; property OldCODIGOCATEGORIA : Integer read GetOldCODIGOCATEGORIAValue; property CATEGORIA : String read GetCATEGORIAValue write SetCATEGORIAValue; property OldCATEGORIA : String read GetOldCATEGORIAValue; public constructor Create(aBusinessProcessor: TDABusinessProcessor); override; destructor Destroy; override; end; implementation uses Variants, uROBinaryHelpers; { 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; { TCOBROSCOMISIONBusinessProcessorRules } constructor TCOBROSCOMISIONBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); begin inherited; end; destructor TCOBROSCOMISIONBusinessProcessorRules.Destroy; begin inherited; end; function TCOBROSCOMISIONBusinessProcessorRules.GetSELECCIONValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONSELECCION]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldSELECCIONValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONSELECCION]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetSELECCIONValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONSELECCION] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetCODIGOEMPRESAValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCODIGOEMPRESA]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldCODIGOEMPRESAValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONCODIGOEMPRESA]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetCODIGOEMPRESAValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCODIGOEMPRESA] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetCODIGOValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCODIGO]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldCODIGOValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONCODIGO]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetCODIGOValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCODIGO] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetCODIGOCONTACTOValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCODIGOCONTACTO]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldCODIGOCONTACTOValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONCODIGOCONTACTO]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetCODIGOCONTACTOValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCODIGOCONTACTO] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetNOMBREValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONNOMBRE]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldNOMBREValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONNOMBRE]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetNOMBREValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONNOMBRE] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetFECHAPAGOValue: DateTime; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONFECHAPAGO]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldFECHAPAGOValue: DateTime; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONFECHAPAGO]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetFECHAPAGOValue(const aValue: DateTime); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONFECHAPAGO] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetIMPORTEValue: Float; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONIMPORTE]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldIMPORTEValue: Float; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONIMPORTE]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetIMPORTEValue(const aValue: Float); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONIMPORTE] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetFORMAPAGOValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONFORMAPAGO]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldFORMAPAGOValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONFORMAPAGO]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetFORMAPAGOValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONFORMAPAGO] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetDESCRIPCIONValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONDESCRIPCION]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldDESCRIPCIONValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONDESCRIPCION]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetDESCRIPCIONValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONDESCRIPCION] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetTIPOValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONTIPO]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldTIPOValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONTIPO]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetTIPOValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONTIPO] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetCODIGOCATEGORIAValue: Integer; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCODIGOCATEGORIA]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldCODIGOCATEGORIAValue: Integer; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONCODIGOCATEGORIA]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetCODIGOCATEGORIAValue(const aValue: Integer); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCODIGOCATEGORIA] := aValue; end; function TCOBROSCOMISIONBusinessProcessorRules.GetCATEGORIAValue: String; begin result := BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCATEGORIA]; end; function TCOBROSCOMISIONBusinessProcessorRules.GetOldCATEGORIAValue: String; begin result := BusinessProcessor.CurrentChange.OldValueByName[fld_COBROSCOMISIONCATEGORIA]; end; procedure TCOBROSCOMISIONBusinessProcessorRules.SetCATEGORIAValue(const aValue: String); begin BusinessProcessor.CurrentChange.NewValueByName[fld_COBROSCOMISIONCATEGORIA] := aValue; end; initialization RegisterBusinessProcessorRules(RID_VENDEDORESCOMISIONDelta, TVENDEDORESCOMISIONBusinessProcessorRules); RegisterBusinessProcessorRules(RID_COMISIONESDelta, TCOMISIONESBusinessProcessorRules); RegisterBusinessProcessorRules(RID_COBROSCOMISIONDelta, TCOBROSCOMISIONBusinessProcessorRules); end.