unit schAsientosClient_Intf; interface uses Classes, DB, SysUtils, uROClasses, uDADataTable; 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_darPenultimoCierre = '{36EB92A1-A369-46F7-AA43-46939BBEA6E0}'; RID_Asientos = '{1CF7245D-9E9B-494C-95B3-595DCBA9FAEF}'; RID_darSumaAcumulada = '{6B4FEB53-EE31-4ABA-BEFE-E8E9A52DB210}'; { Data table names } nme_darPenultimoCierre = 'darPenultimoCierre'; nme_Asientos = 'Asientos'; nme_darSumaAcumulada = 'darSumaAcumulada'; { darPenultimoCierre fields } fld_darPenultimoCierreCODIGO = 'CODIGO'; fld_darPenultimoCierreFECHAASIENTO = 'FECHAASIENTO'; fld_darPenultimoCierreDESCRIPCION = 'DESCRIPCION'; { darPenultimoCierre field indexes } idx_darPenultimoCierreCODIGO = 0; idx_darPenultimoCierreFECHAASIENTO = 1; idx_darPenultimoCierreDESCRIPCION = 2; { Asientos fields } fld_AsientosCODIGO = 'CODIGO'; fld_AsientosCODIGOCUENTA = 'CODIGOCUENTA'; fld_AsientosTIPOASIENTO = 'TIPOASIENTO'; fld_AsientosPUNTEADO = 'PUNTEADO'; fld_AsientosFECHAALTA = 'FECHAALTA'; fld_AsientosUSUARIO = 'USUARIO'; fld_AsientosFECHAASIENTO = 'FECHAASIENTO'; fld_AsientosFORMAPAGO = 'FORMAPAGO'; fld_AsientosDESCRIPCION = 'DESCRIPCION'; fld_AsientosCODIGOPAGO = 'CODIGOPAGO'; fld_AsientosIMPORTE = 'IMPORTE'; fld_AsientosIMPORTEANT = 'IMPORTEANT'; fld_AsientosIMPORTEPOS = 'IMPORTEPOS'; { Asientos field indexes } idx_AsientosCODIGO = 0; idx_AsientosCODIGOCUENTA = 1; idx_AsientosTIPOASIENTO = 2; idx_AsientosPUNTEADO = 3; idx_AsientosFECHAALTA = 4; idx_AsientosUSUARIO = 5; idx_AsientosFECHAASIENTO = 6; idx_AsientosFORMAPAGO = 7; idx_AsientosDESCRIPCION = 8; idx_AsientosCODIGOPAGO = 9; idx_AsientosIMPORTE = 10; idx_AsientosIMPORTEANT = 11; idx_AsientosIMPORTEPOS = 12; { darSumaAcumulada fields } fld_darSumaAcumuladaSUMA = 'SUMA'; { darSumaAcumulada field indexes } idx_darSumaAcumuladaSUMA = 0; type { IdarPenultimoCierre } IdarPenultimoCierre = interface(IDAStronglyTypedDataTable) ['{B0ABEE53-7101-4F92-8485-D1369C557E44}'] { Property getters and setters } function GetCODIGOValue: Integer; procedure SetCODIGOValue(const aValue: Integer); function GetFECHAASIENTOValue: DateTime; procedure SetFECHAASIENTOValue(const aValue: DateTime); function GetDESCRIPCIONValue: String; procedure SetDESCRIPCIONValue(const aValue: String); { Properties } property CODIGO: Integer read GetCODIGOValue write SetCODIGOValue; property FECHAASIENTO: DateTime read GetFECHAASIENTOValue write SetFECHAASIENTOValue; property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; end; { TdarPenultimoCierreDataTableRules } TdarPenultimoCierreDataTableRules = class(TDADataTableRules, IdarPenultimoCierre) private protected { Property getters and setters } function GetCODIGOValue: Integer; virtual; procedure SetCODIGOValue(const aValue: Integer); virtual; function GetFECHAASIENTOValue: DateTime; virtual; procedure SetFECHAASIENTOValue(const aValue: DateTime); virtual; function GetDESCRIPCIONValue: String; virtual; procedure SetDESCRIPCIONValue(const aValue: String); virtual; { Properties } property CODIGO: Integer read GetCODIGOValue write SetCODIGOValue; property FECHAASIENTO: DateTime read GetFECHAASIENTOValue write SetFECHAASIENTOValue; property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; public constructor Create(aDataTable: TDADataTable); override; destructor Destroy; override; end; { IAsientos } IAsientos = interface(IDAStronglyTypedDataTable) ['{AFFFEEE0-A246-4551-9F4C-6105DA8CEB07}'] { Property getters and setters } function GetCODIGOValue: Integer; procedure SetCODIGOValue(const aValue: Integer); function GetCODIGOCUENTAValue: Integer; procedure SetCODIGOCUENTAValue(const aValue: Integer); function GetTIPOASIENTOValue: String; procedure SetTIPOASIENTOValue(const aValue: String); function GetPUNTEADOValue: Integer; procedure SetPUNTEADOValue(const aValue: Integer); function GetFECHAALTAValue: DateTime; procedure SetFECHAALTAValue(const aValue: DateTime); function GetUSUARIOValue: String; procedure SetUSUARIOValue(const aValue: String); function GetFECHAASIENTOValue: DateTime; procedure SetFECHAASIENTOValue(const aValue: DateTime); function GetFORMAPAGOValue: IROStrings; procedure SetFORMAPAGOValue(const aValue: IROStrings); function GetDESCRIPCIONValue: String; procedure SetDESCRIPCIONValue(const aValue: String); function GetCODIGOPAGOValue: Integer; procedure SetCODIGOPAGOValue(const aValue: Integer); function GetIMPORTEValue: Currency; procedure SetIMPORTEValue(const aValue: Currency); function GetIMPORTEANTValue: Currency; procedure SetIMPORTEANTValue(const aValue: Currency); function GetIMPORTEPOSValue: Currency; procedure SetIMPORTEPOSValue(const aValue: Currency); { Properties } property CODIGO: Integer read GetCODIGOValue write SetCODIGOValue; property CODIGOCUENTA: Integer read GetCODIGOCUENTAValue write SetCODIGOCUENTAValue; property TIPOASIENTO: String read GetTIPOASIENTOValue write SetTIPOASIENTOValue; property PUNTEADO: Integer read GetPUNTEADOValue write SetPUNTEADOValue; property FECHAALTA: DateTime read GetFECHAALTAValue write SetFECHAALTAValue; property USUARIO: String read GetUSUARIOValue write SetUSUARIOValue; property FECHAASIENTO: DateTime read GetFECHAASIENTOValue write SetFECHAASIENTOValue; property FORMAPAGO: IROStrings read GetFORMAPAGOValue write SetFORMAPAGOValue; property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; property CODIGOPAGO: Integer read GetCODIGOPAGOValue write SetCODIGOPAGOValue; property IMPORTE: Currency read GetIMPORTEValue write SetIMPORTEValue; property IMPORTEANT: Currency read GetIMPORTEANTValue write SetIMPORTEANTValue; property IMPORTEPOS: Currency read GetIMPORTEPOSValue write SetIMPORTEPOSValue; end; { TAsientosDataTableRules } TAsientosDataTableRules = class(TDADataTableRules, IAsientos) private protected { Property getters and setters } function GetCODIGOValue: Integer; virtual; procedure SetCODIGOValue(const aValue: Integer); virtual; function GetCODIGOCUENTAValue: Integer; virtual; procedure SetCODIGOCUENTAValue(const aValue: Integer); virtual; function GetTIPOASIENTOValue: String; virtual; procedure SetTIPOASIENTOValue(const aValue: String); virtual; function GetPUNTEADOValue: Integer; virtual; procedure SetPUNTEADOValue(const aValue: Integer); virtual; function GetFECHAALTAValue: DateTime; virtual; procedure SetFECHAALTAValue(const aValue: DateTime); virtual; function GetUSUARIOValue: String; virtual; procedure SetUSUARIOValue(const aValue: String); virtual; function GetFECHAASIENTOValue: DateTime; virtual; procedure SetFECHAASIENTOValue(const aValue: DateTime); virtual; function GetFORMAPAGOValue: IROStrings; virtual; procedure SetFORMAPAGOValue(const aValue: IROStrings); virtual; function GetDESCRIPCIONValue: String; virtual; procedure SetDESCRIPCIONValue(const aValue: String); virtual; function GetCODIGOPAGOValue: Integer; virtual; procedure SetCODIGOPAGOValue(const aValue: Integer); virtual; function GetIMPORTEValue: Currency; virtual; procedure SetIMPORTEValue(const aValue: Currency); virtual; function GetIMPORTEANTValue: Currency; virtual; procedure SetIMPORTEANTValue(const aValue: Currency); virtual; function GetIMPORTEPOSValue: Currency; virtual; procedure SetIMPORTEPOSValue(const aValue: Currency); virtual; { Properties } property CODIGO: Integer read GetCODIGOValue write SetCODIGOValue; property CODIGOCUENTA: Integer read GetCODIGOCUENTAValue write SetCODIGOCUENTAValue; property TIPOASIENTO: String read GetTIPOASIENTOValue write SetTIPOASIENTOValue; property PUNTEADO: Integer read GetPUNTEADOValue write SetPUNTEADOValue; property FECHAALTA: DateTime read GetFECHAALTAValue write SetFECHAALTAValue; property USUARIO: String read GetUSUARIOValue write SetUSUARIOValue; property FECHAASIENTO: DateTime read GetFECHAASIENTOValue write SetFECHAASIENTOValue; property FORMAPAGO: IROStrings read GetFORMAPAGOValue write SetFORMAPAGOValue; property DESCRIPCION: String read GetDESCRIPCIONValue write SetDESCRIPCIONValue; property CODIGOPAGO: Integer read GetCODIGOPAGOValue write SetCODIGOPAGOValue; property IMPORTE: Currency read GetIMPORTEValue write SetIMPORTEValue; property IMPORTEANT: Currency read GetIMPORTEANTValue write SetIMPORTEANTValue; property IMPORTEPOS: Currency read GetIMPORTEPOSValue write SetIMPORTEPOSValue; public constructor Create(aDataTable: TDADataTable); override; destructor Destroy; override; end; { IdarSumaAcumulada } IdarSumaAcumulada = interface(IDAStronglyTypedDataTable) ['{7C3C1280-C621-442C-99E5-9286F90974F2}'] { Property getters and setters } function GetSUMAValue: Float; procedure SetSUMAValue(const aValue: Float); { Properties } property SUMA: Float read GetSUMAValue write SetSUMAValue; end; { TdarSumaAcumuladaDataTableRules } TdarSumaAcumuladaDataTableRules = class(TDADataTableRules, IdarSumaAcumulada) private protected { Property getters and setters } function GetSUMAValue: Float; virtual; procedure SetSUMAValue(const aValue: Float); virtual; { Properties } property SUMA: Float read GetSUMAValue write SetSUMAValue; public constructor Create(aDataTable: TDADataTable); override; destructor Destroy; override; end; implementation uses Variants; { TdarPenultimoCierreDataTableRules } constructor TdarPenultimoCierreDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TdarPenultimoCierreDataTableRules.Destroy; begin inherited; end; function TdarPenultimoCierreDataTableRules.GetCODIGOValue: Integer; begin result := DataTable.Fields[idx_darPenultimoCierreCODIGO].AsInteger; end; procedure TdarPenultimoCierreDataTableRules.SetCODIGOValue(const aValue: Integer); begin DataTable.Fields[idx_darPenultimoCierreCODIGO].AsInteger := aValue; end; function TdarPenultimoCierreDataTableRules.GetFECHAASIENTOValue: DateTime; begin result := DataTable.Fields[idx_darPenultimoCierreFECHAASIENTO].AsDateTime; end; procedure TdarPenultimoCierreDataTableRules.SetFECHAASIENTOValue(const aValue: DateTime); begin DataTable.Fields[idx_darPenultimoCierreFECHAASIENTO].AsDateTime := aValue; end; function TdarPenultimoCierreDataTableRules.GetDESCRIPCIONValue: String; begin result := DataTable.Fields[idx_darPenultimoCierreDESCRIPCION].AsString; end; procedure TdarPenultimoCierreDataTableRules.SetDESCRIPCIONValue(const aValue: String); begin DataTable.Fields[idx_darPenultimoCierreDESCRIPCION].AsString := aValue; end; { TAsientosDataTableRules } constructor TAsientosDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TAsientosDataTableRules.Destroy; begin inherited; end; function TAsientosDataTableRules.GetCODIGOValue: Integer; begin result := DataTable.Fields[idx_AsientosCODIGO].AsInteger; end; procedure TAsientosDataTableRules.SetCODIGOValue(const aValue: Integer); begin DataTable.Fields[idx_AsientosCODIGO].AsInteger := aValue; end; function TAsientosDataTableRules.GetCODIGOCUENTAValue: Integer; begin result := DataTable.Fields[idx_AsientosCODIGOCUENTA].AsInteger; end; procedure TAsientosDataTableRules.SetCODIGOCUENTAValue(const aValue: Integer); begin DataTable.Fields[idx_AsientosCODIGOCUENTA].AsInteger := aValue; end; function TAsientosDataTableRules.GetTIPOASIENTOValue: String; begin result := DataTable.Fields[idx_AsientosTIPOASIENTO].AsString; end; procedure TAsientosDataTableRules.SetTIPOASIENTOValue(const aValue: String); begin DataTable.Fields[idx_AsientosTIPOASIENTO].AsString := aValue; end; function TAsientosDataTableRules.GetPUNTEADOValue: Integer; begin result := DataTable.Fields[idx_AsientosPUNTEADO].AsInteger; end; procedure TAsientosDataTableRules.SetPUNTEADOValue(const aValue: Integer); begin DataTable.Fields[idx_AsientosPUNTEADO].AsInteger := aValue; end; function TAsientosDataTableRules.GetFECHAALTAValue: DateTime; begin result := DataTable.Fields[idx_AsientosFECHAALTA].AsDateTime; end; procedure TAsientosDataTableRules.SetFECHAALTAValue(const aValue: DateTime); begin DataTable.Fields[idx_AsientosFECHAALTA].AsDateTime := aValue; end; function TAsientosDataTableRules.GetUSUARIOValue: String; begin result := DataTable.Fields[idx_AsientosUSUARIO].AsString; end; procedure TAsientosDataTableRules.SetUSUARIOValue(const aValue: String); begin DataTable.Fields[idx_AsientosUSUARIO].AsString := aValue; end; function TAsientosDataTableRules.GetFECHAASIENTOValue: DateTime; begin result := DataTable.Fields[idx_AsientosFECHAASIENTO].AsDateTime; end; procedure TAsientosDataTableRules.SetFECHAASIENTOValue(const aValue: DateTime); begin DataTable.Fields[idx_AsientosFECHAASIENTO].AsDateTime := aValue; end; function TAsientosDataTableRules.GetFORMAPAGOValue: IROStrings; begin result := NewROStrings(); result.Text := DataTable.Fields[idx_AsientosFORMAPAGO].AsString; end; procedure TAsientosDataTableRules.SetFORMAPAGOValue(const aValue: IROStrings); begin DataTable.Fields[idx_AsientosFORMAPAGO].AsString := aValue.Text; end; function TAsientosDataTableRules.GetDESCRIPCIONValue: String; begin result := DataTable.Fields[idx_AsientosDESCRIPCION].AsString; end; procedure TAsientosDataTableRules.SetDESCRIPCIONValue(const aValue: String); begin DataTable.Fields[idx_AsientosDESCRIPCION].AsString := aValue; end; function TAsientosDataTableRules.GetCODIGOPAGOValue: Integer; begin result := DataTable.Fields[idx_AsientosCODIGOPAGO].AsInteger; end; procedure TAsientosDataTableRules.SetCODIGOPAGOValue(const aValue: Integer); begin DataTable.Fields[idx_AsientosCODIGOPAGO].AsInteger := aValue; end; function TAsientosDataTableRules.GetIMPORTEValue: Currency; begin result := DataTable.Fields[idx_AsientosIMPORTE].AsCurrency; end; procedure TAsientosDataTableRules.SetIMPORTEValue(const aValue: Currency); begin DataTable.Fields[idx_AsientosIMPORTE].AsCurrency := aValue; end; function TAsientosDataTableRules.GetIMPORTEANTValue: Currency; begin result := DataTable.Fields[idx_AsientosIMPORTEANT].AsCurrency; end; procedure TAsientosDataTableRules.SetIMPORTEANTValue(const aValue: Currency); begin DataTable.Fields[idx_AsientosIMPORTEANT].AsCurrency := aValue; end; function TAsientosDataTableRules.GetIMPORTEPOSValue: Currency; begin result := DataTable.Fields[idx_AsientosIMPORTEPOS].AsCurrency; end; procedure TAsientosDataTableRules.SetIMPORTEPOSValue(const aValue: Currency); begin DataTable.Fields[idx_AsientosIMPORTEPOS].AsCurrency := aValue; end; { TdarSumaAcumuladaDataTableRules } constructor TdarSumaAcumuladaDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TdarSumaAcumuladaDataTableRules.Destroy; begin inherited; end; function TdarSumaAcumuladaDataTableRules.GetSUMAValue: Float; begin result := DataTable.Fields[idx_darSumaAcumuladaSUMA].AsFloat; end; procedure TdarSumaAcumuladaDataTableRules.SetSUMAValue(const aValue: Float); begin DataTable.Fields[idx_darSumaAcumuladaSUMA].AsFloat := aValue; end; initialization RegisterDataTableRules(RID_darPenultimoCierre, TdarPenultimoCierreDataTableRules); RegisterDataTableRules(RID_Asientos, TAsientosDataTableRules); RegisterDataTableRules(RID_darSumaAcumulada, TdarSumaAcumuladaDataTableRules); end.