diff --git a/Source/ApplicationBase/Ejercicios/Model/schEjerciciosClient_Intf.pas b/Source/ApplicationBase/Ejercicios/Model/schEjerciciosClient_Intf.pas new file mode 100644 index 00000000..083293a0 --- /dev/null +++ b/Source/ApplicationBase/Ejercicios/Model/schEjerciciosClient_Intf.pas @@ -0,0 +1,449 @@ +unit schEjerciciosClient_Intf; + +interface + +uses + Classes, DB, SysUtils, uROClasses, uDADataTable, FmtBCD, uROXMLIntf; + +const + { Data table 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_Ejercicios = '{773C8468-2B44-4968-A704-E0A34C02F5CA}'; + + { Data table names } + nme_Ejercicios = 'Ejercicios'; + + { Ejercicios fields } + fld_EjerciciosID = 'ID'; + fld_EjerciciosID_EMPRESA = 'ID_EMPRESA'; + fld_EjerciciosNOMBRE = 'NOMBRE'; + fld_EjerciciosFECHA_INICIO = 'FECHA_INICIO'; + fld_EjerciciosFECHA_FIN = 'FECHA_FIN'; + fld_EjerciciosESTADO = 'ESTADO'; + fld_EjerciciosLONG_SUB_CUENTA = 'LONG_SUB_CUENTA'; + fld_EjerciciosID_ASIENTO_APERTURA = 'ID_ASIENTO_APERTURA'; + fld_EjerciciosID_ASIENTO_PERYGAN = 'ID_ASIENTO_PERYGAN'; + fld_EjerciciosID_ASIENTO_CIERRE = 'ID_ASIENTO_CIERRE'; + fld_EjerciciosACTIVO = 'ACTIVO'; + + { Ejercicios field indexes } + idx_EjerciciosID = 0; + idx_EjerciciosID_EMPRESA = 1; + idx_EjerciciosNOMBRE = 2; + idx_EjerciciosFECHA_INICIO = 3; + idx_EjerciciosFECHA_FIN = 4; + idx_EjerciciosESTADO = 5; + idx_EjerciciosLONG_SUB_CUENTA = 6; + idx_EjerciciosID_ASIENTO_APERTURA = 7; + idx_EjerciciosID_ASIENTO_PERYGAN = 8; + idx_EjerciciosID_ASIENTO_CIERRE = 9; + idx_EjerciciosACTIVO = 10; + +type + { IEjercicios } + IEjercicios = interface(IDAStronglyTypedDataTable) + ['{911EC4DB-1692-4398-AAA2-3127E0B1239C}'] + { Property getters and setters } + function GetIDValue: Integer; + procedure SetIDValue(const aValue: Integer); + function GetIDIsNull: Boolean; + procedure SetIDIsNull(const aValue: Boolean); + function GetID_EMPRESAValue: Integer; + procedure SetID_EMPRESAValue(const aValue: Integer); + function GetID_EMPRESAIsNull: Boolean; + procedure SetID_EMPRESAIsNull(const aValue: Boolean); + function GetNOMBREValue: String; + procedure SetNOMBREValue(const aValue: String); + function GetNOMBREIsNull: Boolean; + procedure SetNOMBREIsNull(const aValue: Boolean); + function GetFECHA_INICIOValue: DateTime; + procedure SetFECHA_INICIOValue(const aValue: DateTime); + function GetFECHA_INICIOIsNull: Boolean; + procedure SetFECHA_INICIOIsNull(const aValue: Boolean); + function GetFECHA_FINValue: DateTime; + procedure SetFECHA_FINValue(const aValue: DateTime); + function GetFECHA_FINIsNull: Boolean; + procedure SetFECHA_FINIsNull(const aValue: Boolean); + function GetESTADOValue: String; + procedure SetESTADOValue(const aValue: String); + function GetESTADOIsNull: Boolean; + procedure SetESTADOIsNull(const aValue: Boolean); + function GetLONG_SUB_CUENTAValue: SmallInt; + procedure SetLONG_SUB_CUENTAValue(const aValue: SmallInt); + function GetLONG_SUB_CUENTAIsNull: Boolean; + procedure SetLONG_SUB_CUENTAIsNull(const aValue: Boolean); + function GetID_ASIENTO_APERTURAValue: Integer; + procedure SetID_ASIENTO_APERTURAValue(const aValue: Integer); + function GetID_ASIENTO_APERTURAIsNull: Boolean; + procedure SetID_ASIENTO_APERTURAIsNull(const aValue: Boolean); + function GetID_ASIENTO_PERYGANValue: Integer; + procedure SetID_ASIENTO_PERYGANValue(const aValue: Integer); + function GetID_ASIENTO_PERYGANIsNull: Boolean; + procedure SetID_ASIENTO_PERYGANIsNull(const aValue: Boolean); + function GetID_ASIENTO_CIERREValue: Integer; + procedure SetID_ASIENTO_CIERREValue(const aValue: Integer); + function GetID_ASIENTO_CIERREIsNull: Boolean; + procedure SetID_ASIENTO_CIERREIsNull(const aValue: Boolean); + function GetACTIVOValue: SmallInt; + procedure SetACTIVOValue(const aValue: SmallInt); + function GetACTIVOIsNull: Boolean; + procedure SetACTIVOIsNull(const aValue: Boolean); + + + { Properties } + property ID: Integer read GetIDValue write SetIDValue; + property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull; + property ID_EMPRESA: Integer read GetID_EMPRESAValue write SetID_EMPRESAValue; + property ID_EMPRESAIsNull: Boolean read GetID_EMPRESAIsNull write SetID_EMPRESAIsNull; + property NOMBRE: String read GetNOMBREValue write SetNOMBREValue; + property NOMBREIsNull: Boolean read GetNOMBREIsNull write SetNOMBREIsNull; + property FECHA_INICIO: DateTime read GetFECHA_INICIOValue write SetFECHA_INICIOValue; + property FECHA_INICIOIsNull: Boolean read GetFECHA_INICIOIsNull write SetFECHA_INICIOIsNull; + property FECHA_FIN: DateTime read GetFECHA_FINValue write SetFECHA_FINValue; + property FECHA_FINIsNull: Boolean read GetFECHA_FINIsNull write SetFECHA_FINIsNull; + property ESTADO: String read GetESTADOValue write SetESTADOValue; + property ESTADOIsNull: Boolean read GetESTADOIsNull write SetESTADOIsNull; + property LONG_SUB_CUENTA: SmallInt read GetLONG_SUB_CUENTAValue write SetLONG_SUB_CUENTAValue; + property LONG_SUB_CUENTAIsNull: Boolean read GetLONG_SUB_CUENTAIsNull write SetLONG_SUB_CUENTAIsNull; + property ID_ASIENTO_APERTURA: Integer read GetID_ASIENTO_APERTURAValue write SetID_ASIENTO_APERTURAValue; + property ID_ASIENTO_APERTURAIsNull: Boolean read GetID_ASIENTO_APERTURAIsNull write SetID_ASIENTO_APERTURAIsNull; + property ID_ASIENTO_PERYGAN: Integer read GetID_ASIENTO_PERYGANValue write SetID_ASIENTO_PERYGANValue; + property ID_ASIENTO_PERYGANIsNull: Boolean read GetID_ASIENTO_PERYGANIsNull write SetID_ASIENTO_PERYGANIsNull; + property ID_ASIENTO_CIERRE: Integer read GetID_ASIENTO_CIERREValue write SetID_ASIENTO_CIERREValue; + property ID_ASIENTO_CIERREIsNull: Boolean read GetID_ASIENTO_CIERREIsNull write SetID_ASIENTO_CIERREIsNull; + property ACTIVO: SmallInt read GetACTIVOValue write SetACTIVOValue; + property ACTIVOIsNull: Boolean read GetACTIVOIsNull write SetACTIVOIsNull; + end; + + { TEjerciciosDataTableRules } + TEjerciciosDataTableRules = class(TDADataTableRules, IEjercicios) + private + protected + { Property getters and setters } + function GetIDValue: Integer; virtual; + procedure SetIDValue(const aValue: Integer); virtual; + function GetIDIsNull: Boolean; virtual; + procedure SetIDIsNull(const aValue: Boolean); virtual; + function GetID_EMPRESAValue: Integer; virtual; + procedure SetID_EMPRESAValue(const aValue: Integer); virtual; + function GetID_EMPRESAIsNull: Boolean; virtual; + procedure SetID_EMPRESAIsNull(const aValue: Boolean); virtual; + function GetNOMBREValue: String; virtual; + procedure SetNOMBREValue(const aValue: String); virtual; + function GetNOMBREIsNull: Boolean; virtual; + procedure SetNOMBREIsNull(const aValue: Boolean); virtual; + function GetFECHA_INICIOValue: DateTime; virtual; + procedure SetFECHA_INICIOValue(const aValue: DateTime); virtual; + function GetFECHA_INICIOIsNull: Boolean; virtual; + procedure SetFECHA_INICIOIsNull(const aValue: Boolean); virtual; + function GetFECHA_FINValue: DateTime; virtual; + procedure SetFECHA_FINValue(const aValue: DateTime); virtual; + function GetFECHA_FINIsNull: Boolean; virtual; + procedure SetFECHA_FINIsNull(const aValue: Boolean); virtual; + function GetESTADOValue: String; virtual; + procedure SetESTADOValue(const aValue: String); virtual; + function GetESTADOIsNull: Boolean; virtual; + procedure SetESTADOIsNull(const aValue: Boolean); virtual; + function GetLONG_SUB_CUENTAValue: SmallInt; virtual; + procedure SetLONG_SUB_CUENTAValue(const aValue: SmallInt); virtual; + function GetLONG_SUB_CUENTAIsNull: Boolean; virtual; + procedure SetLONG_SUB_CUENTAIsNull(const aValue: Boolean); virtual; + function GetID_ASIENTO_APERTURAValue: Integer; virtual; + procedure SetID_ASIENTO_APERTURAValue(const aValue: Integer); virtual; + function GetID_ASIENTO_APERTURAIsNull: Boolean; virtual; + procedure SetID_ASIENTO_APERTURAIsNull(const aValue: Boolean); virtual; + function GetID_ASIENTO_PERYGANValue: Integer; virtual; + procedure SetID_ASIENTO_PERYGANValue(const aValue: Integer); virtual; + function GetID_ASIENTO_PERYGANIsNull: Boolean; virtual; + procedure SetID_ASIENTO_PERYGANIsNull(const aValue: Boolean); virtual; + function GetID_ASIENTO_CIERREValue: Integer; virtual; + procedure SetID_ASIENTO_CIERREValue(const aValue: Integer); virtual; + function GetID_ASIENTO_CIERREIsNull: Boolean; virtual; + procedure SetID_ASIENTO_CIERREIsNull(const aValue: Boolean); virtual; + function GetACTIVOValue: SmallInt; virtual; + procedure SetACTIVOValue(const aValue: SmallInt); virtual; + function GetACTIVOIsNull: Boolean; virtual; + procedure SetACTIVOIsNull(const aValue: Boolean); virtual; + + { Properties } + property ID: Integer read GetIDValue write SetIDValue; + property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull; + property ID_EMPRESA: Integer read GetID_EMPRESAValue write SetID_EMPRESAValue; + property ID_EMPRESAIsNull: Boolean read GetID_EMPRESAIsNull write SetID_EMPRESAIsNull; + property NOMBRE: String read GetNOMBREValue write SetNOMBREValue; + property NOMBREIsNull: Boolean read GetNOMBREIsNull write SetNOMBREIsNull; + property FECHA_INICIO: DateTime read GetFECHA_INICIOValue write SetFECHA_INICIOValue; + property FECHA_INICIOIsNull: Boolean read GetFECHA_INICIOIsNull write SetFECHA_INICIOIsNull; + property FECHA_FIN: DateTime read GetFECHA_FINValue write SetFECHA_FINValue; + property FECHA_FINIsNull: Boolean read GetFECHA_FINIsNull write SetFECHA_FINIsNull; + property ESTADO: String read GetESTADOValue write SetESTADOValue; + property ESTADOIsNull: Boolean read GetESTADOIsNull write SetESTADOIsNull; + property LONG_SUB_CUENTA: SmallInt read GetLONG_SUB_CUENTAValue write SetLONG_SUB_CUENTAValue; + property LONG_SUB_CUENTAIsNull: Boolean read GetLONG_SUB_CUENTAIsNull write SetLONG_SUB_CUENTAIsNull; + property ID_ASIENTO_APERTURA: Integer read GetID_ASIENTO_APERTURAValue write SetID_ASIENTO_APERTURAValue; + property ID_ASIENTO_APERTURAIsNull: Boolean read GetID_ASIENTO_APERTURAIsNull write SetID_ASIENTO_APERTURAIsNull; + property ID_ASIENTO_PERYGAN: Integer read GetID_ASIENTO_PERYGANValue write SetID_ASIENTO_PERYGANValue; + property ID_ASIENTO_PERYGANIsNull: Boolean read GetID_ASIENTO_PERYGANIsNull write SetID_ASIENTO_PERYGANIsNull; + property ID_ASIENTO_CIERRE: Integer read GetID_ASIENTO_CIERREValue write SetID_ASIENTO_CIERREValue; + property ID_ASIENTO_CIERREIsNull: Boolean read GetID_ASIENTO_CIERREIsNull write SetID_ASIENTO_CIERREIsNull; + property ACTIVO: SmallInt read GetACTIVOValue write SetACTIVOValue; + property ACTIVOIsNull: Boolean read GetACTIVOIsNull write SetACTIVOIsNull; + + public + constructor Create(aDataTable: TDADataTable); override; + destructor Destroy; override; + + end; + +implementation + +uses Variants, uROBinaryHelpers; + +{ TEjerciciosDataTableRules } +constructor TEjerciciosDataTableRules.Create(aDataTable: TDADataTable); +begin + inherited; +end; + +destructor TEjerciciosDataTableRules.Destroy; +begin + inherited; +end; + +function TEjerciciosDataTableRules.GetIDValue: Integer; +begin + result := DataTable.Fields[idx_EjerciciosID].AsInteger; +end; + +procedure TEjerciciosDataTableRules.SetIDValue(const aValue: Integer); +begin + DataTable.Fields[idx_EjerciciosID].AsInteger := aValue; +end; + +function TEjerciciosDataTableRules.GetIDIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosID].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosID].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetID_EMPRESAValue: Integer; +begin + result := DataTable.Fields[idx_EjerciciosID_EMPRESA].AsInteger; +end; + +procedure TEjerciciosDataTableRules.SetID_EMPRESAValue(const aValue: Integer); +begin + DataTable.Fields[idx_EjerciciosID_EMPRESA].AsInteger := aValue; +end; + +function TEjerciciosDataTableRules.GetID_EMPRESAIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosID_EMPRESA].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetID_EMPRESAIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosID_EMPRESA].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetNOMBREValue: String; +begin + result := DataTable.Fields[idx_EjerciciosNOMBRE].AsString; +end; + +procedure TEjerciciosDataTableRules.SetNOMBREValue(const aValue: String); +begin + DataTable.Fields[idx_EjerciciosNOMBRE].AsString := aValue; +end; + +function TEjerciciosDataTableRules.GetNOMBREIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosNOMBRE].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetNOMBREIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosNOMBRE].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetFECHA_INICIOValue: DateTime; +begin + result := DataTable.Fields[idx_EjerciciosFECHA_INICIO].AsDateTime; +end; + +procedure TEjerciciosDataTableRules.SetFECHA_INICIOValue(const aValue: DateTime); +begin + DataTable.Fields[idx_EjerciciosFECHA_INICIO].AsDateTime := aValue; +end; + +function TEjerciciosDataTableRules.GetFECHA_INICIOIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosFECHA_INICIO].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetFECHA_INICIOIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosFECHA_INICIO].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetFECHA_FINValue: DateTime; +begin + result := DataTable.Fields[idx_EjerciciosFECHA_FIN].AsDateTime; +end; + +procedure TEjerciciosDataTableRules.SetFECHA_FINValue(const aValue: DateTime); +begin + DataTable.Fields[idx_EjerciciosFECHA_FIN].AsDateTime := aValue; +end; + +function TEjerciciosDataTableRules.GetFECHA_FINIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosFECHA_FIN].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetFECHA_FINIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosFECHA_FIN].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetESTADOValue: String; +begin + result := DataTable.Fields[idx_EjerciciosESTADO].AsString; +end; + +procedure TEjerciciosDataTableRules.SetESTADOValue(const aValue: String); +begin + DataTable.Fields[idx_EjerciciosESTADO].AsString := aValue; +end; + +function TEjerciciosDataTableRules.GetESTADOIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosESTADO].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetESTADOIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosESTADO].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetLONG_SUB_CUENTAValue: SmallInt; +begin + result := DataTable.Fields[idx_EjerciciosLONG_SUB_CUENTA].AsSmallInt; +end; + +procedure TEjerciciosDataTableRules.SetLONG_SUB_CUENTAValue(const aValue: SmallInt); +begin + DataTable.Fields[idx_EjerciciosLONG_SUB_CUENTA].AsSmallInt := aValue; +end; + +function TEjerciciosDataTableRules.GetLONG_SUB_CUENTAIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosLONG_SUB_CUENTA].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetLONG_SUB_CUENTAIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosLONG_SUB_CUENTA].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetID_ASIENTO_APERTURAValue: Integer; +begin + result := DataTable.Fields[idx_EjerciciosID_ASIENTO_APERTURA].AsInteger; +end; + +procedure TEjerciciosDataTableRules.SetID_ASIENTO_APERTURAValue(const aValue: Integer); +begin + DataTable.Fields[idx_EjerciciosID_ASIENTO_APERTURA].AsInteger := aValue; +end; + +function TEjerciciosDataTableRules.GetID_ASIENTO_APERTURAIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosID_ASIENTO_APERTURA].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetID_ASIENTO_APERTURAIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosID_ASIENTO_APERTURA].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetID_ASIENTO_PERYGANValue: Integer; +begin + result := DataTable.Fields[idx_EjerciciosID_ASIENTO_PERYGAN].AsInteger; +end; + +procedure TEjerciciosDataTableRules.SetID_ASIENTO_PERYGANValue(const aValue: Integer); +begin + DataTable.Fields[idx_EjerciciosID_ASIENTO_PERYGAN].AsInteger := aValue; +end; + +function TEjerciciosDataTableRules.GetID_ASIENTO_PERYGANIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosID_ASIENTO_PERYGAN].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetID_ASIENTO_PERYGANIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosID_ASIENTO_PERYGAN].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetID_ASIENTO_CIERREValue: Integer; +begin + result := DataTable.Fields[idx_EjerciciosID_ASIENTO_CIERRE].AsInteger; +end; + +procedure TEjerciciosDataTableRules.SetID_ASIENTO_CIERREValue(const aValue: Integer); +begin + DataTable.Fields[idx_EjerciciosID_ASIENTO_CIERRE].AsInteger := aValue; +end; + +function TEjerciciosDataTableRules.GetID_ASIENTO_CIERREIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosID_ASIENTO_CIERRE].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetID_ASIENTO_CIERREIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosID_ASIENTO_CIERRE].AsVariant := Null; +end; + +function TEjerciciosDataTableRules.GetACTIVOValue: SmallInt; +begin + result := DataTable.Fields[idx_EjerciciosACTIVO].AsSmallInt; +end; + +procedure TEjerciciosDataTableRules.SetACTIVOValue(const aValue: SmallInt); +begin + DataTable.Fields[idx_EjerciciosACTIVO].AsSmallInt := aValue; +end; + +function TEjerciciosDataTableRules.GetACTIVOIsNull: boolean; +begin + result := DataTable.Fields[idx_EjerciciosACTIVO].IsNull; +end; + +procedure TEjerciciosDataTableRules.SetACTIVOIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_EjerciciosACTIVO].AsVariant := Null; +end; + + +initialization + RegisterDataTableRules(RID_Ejercicios, TEjerciciosDataTableRules); + +end. diff --git a/Source/ApplicationBase/Ejercicios/Model/schEjerciciosServer_Intf.pas b/Source/ApplicationBase/Ejercicios/Model/schEjerciciosServer_Intf.pas new file mode 100644 index 00000000..4cd11fe6 --- /dev/null +++ b/Source/ApplicationBase/Ejercicios/Model/schEjerciciosServer_Intf.pas @@ -0,0 +1,530 @@ +unit schEjerciciosServer_Intf; + +interface + +uses + Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, FmtBCD, uROXMLIntf, schEjerciciosClient_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_EjerciciosDelta = '{CDD1664B-E7FC-4A22-B77D-7FE7419A3314}'; + +type + { IEjerciciosDelta } + IEjerciciosDelta = interface(IEjercicios) + ['{CDD1664B-E7FC-4A22-B77D-7FE7419A3314}'] + { Property getters and setters } + function GetOldIDValue : Integer; + function GetOldID_EMPRESAValue : Integer; + function GetOldNOMBREValue : String; + function GetOldFECHA_INICIOValue : DateTime; + function GetOldFECHA_FINValue : DateTime; + function GetOldESTADOValue : String; + function GetOldLONG_SUB_CUENTAValue : SmallInt; + function GetOldID_ASIENTO_APERTURAValue : Integer; + function GetOldID_ASIENTO_PERYGANValue : Integer; + function GetOldID_ASIENTO_CIERREValue : Integer; + function GetOldACTIVOValue : SmallInt; + + { Properties } + property OldID : Integer read GetOldIDValue; + property OldID_EMPRESA : Integer read GetOldID_EMPRESAValue; + property OldNOMBRE : String read GetOldNOMBREValue; + property OldFECHA_INICIO : DateTime read GetOldFECHA_INICIOValue; + property OldFECHA_FIN : DateTime read GetOldFECHA_FINValue; + property OldESTADO : String read GetOldESTADOValue; + property OldLONG_SUB_CUENTA : SmallInt read GetOldLONG_SUB_CUENTAValue; + property OldID_ASIENTO_APERTURA : Integer read GetOldID_ASIENTO_APERTURAValue; + property OldID_ASIENTO_PERYGAN : Integer read GetOldID_ASIENTO_PERYGANValue; + property OldID_ASIENTO_CIERRE : Integer read GetOldID_ASIENTO_CIERREValue; + property OldACTIVO : SmallInt read GetOldACTIVOValue; + end; + + { TEjerciciosBusinessProcessorRules } + TEjerciciosBusinessProcessorRules = class(TDABusinessProcessorRules, IEjercicios, IEjerciciosDelta) + 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 GetID_EMPRESAValue: Integer; virtual; + function GetID_EMPRESAIsNull: Boolean; virtual; + function GetOldID_EMPRESAValue: Integer; virtual; + function GetOldID_EMPRESAIsNull: Boolean; virtual; + procedure SetID_EMPRESAValue(const aValue: Integer); virtual; + procedure SetID_EMPRESAIsNull(const aValue: Boolean); virtual; + function GetNOMBREValue: String; virtual; + function GetNOMBREIsNull: Boolean; virtual; + function GetOldNOMBREValue: String; virtual; + function GetOldNOMBREIsNull: Boolean; virtual; + procedure SetNOMBREValue(const aValue: String); virtual; + procedure SetNOMBREIsNull(const aValue: Boolean); virtual; + function GetFECHA_INICIOValue: DateTime; virtual; + function GetFECHA_INICIOIsNull: Boolean; virtual; + function GetOldFECHA_INICIOValue: DateTime; virtual; + function GetOldFECHA_INICIOIsNull: Boolean; virtual; + procedure SetFECHA_INICIOValue(const aValue: DateTime); virtual; + procedure SetFECHA_INICIOIsNull(const aValue: Boolean); virtual; + function GetFECHA_FINValue: DateTime; virtual; + function GetFECHA_FINIsNull: Boolean; virtual; + function GetOldFECHA_FINValue: DateTime; virtual; + function GetOldFECHA_FINIsNull: Boolean; virtual; + procedure SetFECHA_FINValue(const aValue: DateTime); virtual; + procedure SetFECHA_FINIsNull(const aValue: Boolean); virtual; + function GetESTADOValue: String; virtual; + function GetESTADOIsNull: Boolean; virtual; + function GetOldESTADOValue: String; virtual; + function GetOldESTADOIsNull: Boolean; virtual; + procedure SetESTADOValue(const aValue: String); virtual; + procedure SetESTADOIsNull(const aValue: Boolean); virtual; + function GetLONG_SUB_CUENTAValue: SmallInt; virtual; + function GetLONG_SUB_CUENTAIsNull: Boolean; virtual; + function GetOldLONG_SUB_CUENTAValue: SmallInt; virtual; + function GetOldLONG_SUB_CUENTAIsNull: Boolean; virtual; + procedure SetLONG_SUB_CUENTAValue(const aValue: SmallInt); virtual; + procedure SetLONG_SUB_CUENTAIsNull(const aValue: Boolean); virtual; + function GetID_ASIENTO_APERTURAValue: Integer; virtual; + function GetID_ASIENTO_APERTURAIsNull: Boolean; virtual; + function GetOldID_ASIENTO_APERTURAValue: Integer; virtual; + function GetOldID_ASIENTO_APERTURAIsNull: Boolean; virtual; + procedure SetID_ASIENTO_APERTURAValue(const aValue: Integer); virtual; + procedure SetID_ASIENTO_APERTURAIsNull(const aValue: Boolean); virtual; + function GetID_ASIENTO_PERYGANValue: Integer; virtual; + function GetID_ASIENTO_PERYGANIsNull: Boolean; virtual; + function GetOldID_ASIENTO_PERYGANValue: Integer; virtual; + function GetOldID_ASIENTO_PERYGANIsNull: Boolean; virtual; + procedure SetID_ASIENTO_PERYGANValue(const aValue: Integer); virtual; + procedure SetID_ASIENTO_PERYGANIsNull(const aValue: Boolean); virtual; + function GetID_ASIENTO_CIERREValue: Integer; virtual; + function GetID_ASIENTO_CIERREIsNull: Boolean; virtual; + function GetOldID_ASIENTO_CIERREValue: Integer; virtual; + function GetOldID_ASIENTO_CIERREIsNull: Boolean; virtual; + procedure SetID_ASIENTO_CIERREValue(const aValue: Integer); virtual; + procedure SetID_ASIENTO_CIERREIsNull(const aValue: Boolean); virtual; + function GetACTIVOValue: SmallInt; virtual; + function GetACTIVOIsNull: Boolean; virtual; + function GetOldACTIVOValue: SmallInt; virtual; + function GetOldACTIVOIsNull: Boolean; virtual; + procedure SetACTIVOValue(const aValue: SmallInt); virtual; + procedure SetACTIVOIsNull(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 ID_EMPRESA : Integer read GetID_EMPRESAValue write SetID_EMPRESAValue; + property ID_EMPRESAIsNull : Boolean read GetID_EMPRESAIsNull write SetID_EMPRESAIsNull; + property OldID_EMPRESA : Integer read GetOldID_EMPRESAValue; + property OldID_EMPRESAIsNull : Boolean read GetOldID_EMPRESAIsNull; + property NOMBRE : String read GetNOMBREValue write SetNOMBREValue; + property NOMBREIsNull : Boolean read GetNOMBREIsNull write SetNOMBREIsNull; + property OldNOMBRE : String read GetOldNOMBREValue; + property OldNOMBREIsNull : Boolean read GetOldNOMBREIsNull; + property FECHA_INICIO : DateTime read GetFECHA_INICIOValue write SetFECHA_INICIOValue; + property FECHA_INICIOIsNull : Boolean read GetFECHA_INICIOIsNull write SetFECHA_INICIOIsNull; + property OldFECHA_INICIO : DateTime read GetOldFECHA_INICIOValue; + property OldFECHA_INICIOIsNull : Boolean read GetOldFECHA_INICIOIsNull; + property FECHA_FIN : DateTime read GetFECHA_FINValue write SetFECHA_FINValue; + property FECHA_FINIsNull : Boolean read GetFECHA_FINIsNull write SetFECHA_FINIsNull; + property OldFECHA_FIN : DateTime read GetOldFECHA_FINValue; + property OldFECHA_FINIsNull : Boolean read GetOldFECHA_FINIsNull; + property ESTADO : String read GetESTADOValue write SetESTADOValue; + property ESTADOIsNull : Boolean read GetESTADOIsNull write SetESTADOIsNull; + property OldESTADO : String read GetOldESTADOValue; + property OldESTADOIsNull : Boolean read GetOldESTADOIsNull; + property LONG_SUB_CUENTA : SmallInt read GetLONG_SUB_CUENTAValue write SetLONG_SUB_CUENTAValue; + property LONG_SUB_CUENTAIsNull : Boolean read GetLONG_SUB_CUENTAIsNull write SetLONG_SUB_CUENTAIsNull; + property OldLONG_SUB_CUENTA : SmallInt read GetOldLONG_SUB_CUENTAValue; + property OldLONG_SUB_CUENTAIsNull : Boolean read GetOldLONG_SUB_CUENTAIsNull; + property ID_ASIENTO_APERTURA : Integer read GetID_ASIENTO_APERTURAValue write SetID_ASIENTO_APERTURAValue; + property ID_ASIENTO_APERTURAIsNull : Boolean read GetID_ASIENTO_APERTURAIsNull write SetID_ASIENTO_APERTURAIsNull; + property OldID_ASIENTO_APERTURA : Integer read GetOldID_ASIENTO_APERTURAValue; + property OldID_ASIENTO_APERTURAIsNull : Boolean read GetOldID_ASIENTO_APERTURAIsNull; + property ID_ASIENTO_PERYGAN : Integer read GetID_ASIENTO_PERYGANValue write SetID_ASIENTO_PERYGANValue; + property ID_ASIENTO_PERYGANIsNull : Boolean read GetID_ASIENTO_PERYGANIsNull write SetID_ASIENTO_PERYGANIsNull; + property OldID_ASIENTO_PERYGAN : Integer read GetOldID_ASIENTO_PERYGANValue; + property OldID_ASIENTO_PERYGANIsNull : Boolean read GetOldID_ASIENTO_PERYGANIsNull; + property ID_ASIENTO_CIERRE : Integer read GetID_ASIENTO_CIERREValue write SetID_ASIENTO_CIERREValue; + property ID_ASIENTO_CIERREIsNull : Boolean read GetID_ASIENTO_CIERREIsNull write SetID_ASIENTO_CIERREIsNull; + property OldID_ASIENTO_CIERRE : Integer read GetOldID_ASIENTO_CIERREValue; + property OldID_ASIENTO_CIERREIsNull : Boolean read GetOldID_ASIENTO_CIERREIsNull; + property ACTIVO : SmallInt read GetACTIVOValue write SetACTIVOValue; + property ACTIVOIsNull : Boolean read GetACTIVOIsNull write SetACTIVOIsNull; + property OldACTIVO : SmallInt read GetOldACTIVOValue; + property OldACTIVOIsNull : Boolean read GetOldACTIVOIsNull; + + public + constructor Create(aBusinessProcessor: TDABusinessProcessor); override; + destructor Destroy; override; + + end; + +implementation + +uses + Variants, uROBinaryHelpers, uDAInterfaces; + +{ TEjerciciosBusinessProcessorRules } +constructor TEjerciciosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); +begin + inherited; +end; + +destructor TEjerciciosBusinessProcessorRules.Destroy; +begin + inherited; +end; + +function TEjerciciosBusinessProcessorRules.GetIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID]; +end; + +function TEjerciciosBusinessProcessorRules.GetIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetIDValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetID_EMPRESAValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_EMPRESA]; +end; + +function TEjerciciosBusinessProcessorRules.GetID_EMPRESAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_EMPRESA]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldID_EMPRESAValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID_EMPRESA]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldID_EMPRESAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID_EMPRESA]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetID_EMPRESAValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_EMPRESA] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetID_EMPRESAIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_EMPRESA] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetNOMBREValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosNOMBRE]; +end; + +function TEjerciciosBusinessProcessorRules.GetNOMBREIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosNOMBRE]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldNOMBREValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosNOMBRE]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldNOMBREIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosNOMBRE]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetNOMBREValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosNOMBRE] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetNOMBREIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosNOMBRE] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetFECHA_INICIOValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosFECHA_INICIO]; +end; + +function TEjerciciosBusinessProcessorRules.GetFECHA_INICIOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosFECHA_INICIO]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldFECHA_INICIOValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosFECHA_INICIO]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldFECHA_INICIOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosFECHA_INICIO]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetFECHA_INICIOValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosFECHA_INICIO] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetFECHA_INICIOIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosFECHA_INICIO] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetFECHA_FINValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosFECHA_FIN]; +end; + +function TEjerciciosBusinessProcessorRules.GetFECHA_FINIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosFECHA_FIN]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldFECHA_FINValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosFECHA_FIN]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldFECHA_FINIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosFECHA_FIN]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetFECHA_FINValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosFECHA_FIN] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetFECHA_FINIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosFECHA_FIN] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetESTADOValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosESTADO]; +end; + +function TEjerciciosBusinessProcessorRules.GetESTADOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosESTADO]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldESTADOValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosESTADO]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldESTADOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosESTADO]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetESTADOValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosESTADO] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetESTADOIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosESTADO] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetLONG_SUB_CUENTAValue: SmallInt; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosLONG_SUB_CUENTA]; +end; + +function TEjerciciosBusinessProcessorRules.GetLONG_SUB_CUENTAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosLONG_SUB_CUENTA]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldLONG_SUB_CUENTAValue: SmallInt; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosLONG_SUB_CUENTA]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldLONG_SUB_CUENTAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosLONG_SUB_CUENTA]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetLONG_SUB_CUENTAValue(const aValue: SmallInt); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosLONG_SUB_CUENTA] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetLONG_SUB_CUENTAIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosLONG_SUB_CUENTA] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetID_ASIENTO_APERTURAValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_APERTURA]; +end; + +function TEjerciciosBusinessProcessorRules.GetID_ASIENTO_APERTURAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_APERTURA]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldID_ASIENTO_APERTURAValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID_ASIENTO_APERTURA]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldID_ASIENTO_APERTURAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID_ASIENTO_APERTURA]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetID_ASIENTO_APERTURAValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_APERTURA] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetID_ASIENTO_APERTURAIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_APERTURA] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetID_ASIENTO_PERYGANValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_PERYGAN]; +end; + +function TEjerciciosBusinessProcessorRules.GetID_ASIENTO_PERYGANIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_PERYGAN]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldID_ASIENTO_PERYGANValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID_ASIENTO_PERYGAN]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldID_ASIENTO_PERYGANIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID_ASIENTO_PERYGAN]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetID_ASIENTO_PERYGANValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_PERYGAN] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetID_ASIENTO_PERYGANIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_PERYGAN] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetID_ASIENTO_CIERREValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_CIERRE]; +end; + +function TEjerciciosBusinessProcessorRules.GetID_ASIENTO_CIERREIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_CIERRE]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldID_ASIENTO_CIERREValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID_ASIENTO_CIERRE]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldID_ASIENTO_CIERREIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosID_ASIENTO_CIERRE]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetID_ASIENTO_CIERREValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_CIERRE] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetID_ASIENTO_CIERREIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosID_ASIENTO_CIERRE] := Null; +end; + +function TEjerciciosBusinessProcessorRules.GetACTIVOValue: SmallInt; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosACTIVO]; +end; + +function TEjerciciosBusinessProcessorRules.GetACTIVOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosACTIVO]); +end; + +function TEjerciciosBusinessProcessorRules.GetOldACTIVOValue: SmallInt; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosACTIVO]; +end; + +function TEjerciciosBusinessProcessorRules.GetOldACTIVOIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_EjerciciosACTIVO]); +end; + +procedure TEjerciciosBusinessProcessorRules.SetACTIVOValue(const aValue: SmallInt); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosACTIVO] := aValue; +end; + +procedure TEjerciciosBusinessProcessorRules.SetACTIVOIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_EjerciciosACTIVO] := Null; +end; + + +initialization + RegisterBusinessProcessorRules(RID_EjerciciosDelta, TEjerciciosBusinessProcessorRules); + +end. diff --git a/Source/ApplicationBase/Ejercicios/Model/uBizEjercicios.pas b/Source/ApplicationBase/Ejercicios/Model/uBizEjercicios.pas new file mode 100644 index 00000000..adb0599f --- /dev/null +++ b/Source/ApplicationBase/Ejercicios/Model/uBizEjercicios.pas @@ -0,0 +1,55 @@ +unit uBizEjercicios; + +interface + +uses + uDAInterfaces, uDADataTable, schEjerciciosClient_Intf; + +const + BIZ_CLIENT_Ejercicio = 'Client.Ejercicio'; + +type + IBizEjercicio = interface(IEjercicios) + ['{328DA20D-75E5-47D5-A0D6-C7036E2A038F}'] + function EsNuevo : Boolean; + end; + + TBizEjercicio = class(TEjerciciosDataTableRules, IBizEjercicio) + protected + procedure OnNewRecord(Sender: TDADataTable); override; + public + procedure IniciarValoresEjercicioNueva; + function EsNuevo : Boolean; + end; + +implementation + +{ TBizEjercicio } + +uses + SysUtils, uDataTableUtils, uFactuGES_App; + +function TBizEjercicio.EsNuevo: Boolean; +begin + Result := (ID < 0); +end; + +procedure TBizEjercicio.IniciarValoresEjercicioNueva; +begin + ID_EMPRESA := AppFactuGES.EmpresaActiva.ID; + ACTIVO := 1; +end; + +procedure TBizEjercicio.OnNewRecord(Sender: TDADataTable); +begin + inherited; + IniciarValoresEjercicioNueva; +end; + +initialization + RegisterDataTableRules(BIZ_CLIENT_Ejercicio, TBizEjercicio); + +finalization + +end. + diff --git a/Source/ApplicationBase/Ejercicios/Model/uBizEjerciciosServer.pas b/Source/ApplicationBase/Ejercicios/Model/uBizEjerciciosServer.pas new file mode 100644 index 00000000..b80b68d9 --- /dev/null +++ b/Source/ApplicationBase/Ejercicios/Model/uBizEjerciciosServer.pas @@ -0,0 +1,57 @@ +unit uBizEjerciciosServer; + +interface + +uses + uDAInterfaces, uDADelta, uDABusinessProcessor, + schEjerciciosServer_Intf; + +const + BIZ_SERVER_EJERCICIOS = 'Server.Ejercicios'; + +type + TBizEjerciciosServer = class(TEjerciciosBusinessProcessorRules) + protected + procedure BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); override; + end; + +implementation + +uses + Variants, uDAClasses, uReferenciasUtils, uBusinessUtils, uROClasses, uDataModuleServer, + schEjerciciosClient_Intf; + +{ TBizEjerciciosServer } + +procedure TBizEjerciciosServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta); +var + ASchema : TDASchema; + ACurrentConn : IDAConnection; + Empresa : Variant; + +begin + inherited; + case Sender.CurrentChange.ChangeType of + ctInsert, ctUpdate: begin + //Si el ejercicio es activo debemos poner los demas ejercicios de la empresa a no activos + if (Sender.CurrentChange.NewValueByName[fld_EjerciciosACTIVO] = 1) then + begin + ASchema := BusinessProcessor.Schema; + ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor); + + try + //Siempre va a estar rellena + Empresa := Sender.CurrentChange.NewValueByName[fld_EjerciciosID_EMPRESA]; + ASchema.NewCommand(ACurrentConn, 'SetEjerciciosNoActivos', ['ID_EMPRESA'], [Empresa]) + except + RaiseError('Error al desactivar los ejercicios de la empresa'); + end; + end; + end; + end; +end; + +initialization + RegisterBusinessProcessorRules(BIZ_SERVER_EJERCICIOS, TBizEjerciciosServer); + +end.