unit schComisionesClient_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_ALBARANESCOMISION = '{95988F77-1F21-4DDF-A2F1-5699425F60BF}'; RID_VENDEDORESCOMISION = '{7BBA7ED1-2A13-4B1F-ADF6-40FAA4D82CAF}'; RID_COMISIONES = '{B8D2ED9F-6C42-4249-869C-BEF3487CA8C6}'; { Data table names } nme_ALBARANESCOMISION = 'ALBARANESCOMISION'; nme_VENDEDORESCOMISION = 'VENDEDORESCOMISION'; nme_COMISIONES = 'COMISIONES'; { ALBARANESCOMISION fields } fld_ALBARANESCOMISIONSELECCION = 'SELECCION'; fld_ALBARANESCOMISIONCODIGOEMPRESA = 'CODIGOEMPRESA'; fld_ALBARANESCOMISIONCODIGO = 'CODIGO'; fld_ALBARANESCOMISIONREFERENCIA = 'REFERENCIA'; fld_ALBARANESCOMISIONCODIGOCONTACTO = 'CODIGOCONTACTO'; fld_ALBARANESCOMISIONNOMBRE = 'NOMBRE'; fld_ALBARANESCOMISIONFECHAALBARAN = 'FECHAALBARAN'; fld_ALBARANESCOMISIONSITUACION = 'SITUACION'; fld_ALBARANESCOMISIONFECHAPAGO = 'FECHAPAGO'; fld_ALBARANESCOMISIONIMPORTETOTAL = 'IMPORTETOTAL'; fld_ALBARANESCOMISIONCODIGOPRESUPUESTO = 'CODIGOPRESUPUESTO'; fld_ALBARANESCOMISIONREFERENCIAPRESUPUESTO = 'REFERENCIAPRESUPUESTO'; { ALBARANESCOMISION field indexes } idx_ALBARANESCOMISIONSELECCION = 0; idx_ALBARANESCOMISIONCODIGOEMPRESA = 1; idx_ALBARANESCOMISIONCODIGO = 2; idx_ALBARANESCOMISIONREFERENCIA = 3; idx_ALBARANESCOMISIONCODIGOCONTACTO = 4; idx_ALBARANESCOMISIONNOMBRE = 5; idx_ALBARANESCOMISIONFECHAALBARAN = 6; idx_ALBARANESCOMISIONSITUACION = 7; idx_ALBARANESCOMISIONFECHAPAGO = 8; idx_ALBARANESCOMISIONIMPORTETOTAL = 9; idx_ALBARANESCOMISIONCODIGOPRESUPUESTO = 10; idx_ALBARANESCOMISIONREFERENCIAPRESUPUESTO = 11; { VENDEDORESCOMISION fields } fld_VENDEDORESCOMISIONVENDEDOR = 'VENDEDOR'; fld_VENDEDORESCOMISIONPORCENTAJE = 'PORCENTAJE'; fld_VENDEDORESCOMISIONCOMISION = 'COMISION'; { VENDEDORESCOMISION field indexes } idx_VENDEDORESCOMISIONVENDEDOR = 0; idx_VENDEDORESCOMISIONPORCENTAJE = 1; idx_VENDEDORESCOMISIONCOMISION = 2; { COMISIONES fields } fld_COMISIONESCOMISION = 'COMISION'; { COMISIONES field indexes } idx_COMISIONESCOMISION = 0; type { IALBARANESCOMISION } IALBARANESCOMISION = interface(IDAStronglyTypedDataTable) ['{6AE1A2C0-9A9A-4144-BC88-B536969DDF1E}'] { Property getters and setters } function GetSELECCIONValue: Integer; procedure SetSELECCIONValue(const aValue: Integer); function GetCODIGOEMPRESAValue: Integer; procedure SetCODIGOEMPRESAValue(const aValue: Integer); function GetCODIGOValue: Integer; procedure SetCODIGOValue(const aValue: Integer); function GetREFERENCIAValue: String; procedure SetREFERENCIAValue(const aValue: String); function GetCODIGOCONTACTOValue: Integer; procedure SetCODIGOCONTACTOValue(const aValue: Integer); function GetNOMBREValue: String; procedure SetNOMBREValue(const aValue: String); function GetFECHAALBARANValue: DateTime; procedure SetFECHAALBARANValue(const aValue: DateTime); function GetSITUACIONValue: String; procedure SetSITUACIONValue(const aValue: String); function GetFECHAPAGOValue: DateTime; procedure SetFECHAPAGOValue(const aValue: DateTime); function GetIMPORTETOTALValue: Currency; procedure SetIMPORTETOTALValue(const aValue: Currency); function GetCODIGOPRESUPUESTOValue: Integer; procedure SetCODIGOPRESUPUESTOValue(const aValue: Integer); function GetREFERENCIAPRESUPUESTOValue: String; procedure SetREFERENCIAPRESUPUESTOValue(const aValue: String); { Properties } property SELECCION: Integer read GetSELECCIONValue write SetSELECCIONValue; property CODIGOEMPRESA: Integer read GetCODIGOEMPRESAValue write SetCODIGOEMPRESAValue; property CODIGO: Integer read GetCODIGOValue write SetCODIGOValue; property REFERENCIA: String read GetREFERENCIAValue write SetREFERENCIAValue; property CODIGOCONTACTO: Integer read GetCODIGOCONTACTOValue write SetCODIGOCONTACTOValue; property NOMBRE: String read GetNOMBREValue write SetNOMBREValue; property FECHAALBARAN: DateTime read GetFECHAALBARANValue write SetFECHAALBARANValue; property SITUACION: String read GetSITUACIONValue write SetSITUACIONValue; property FECHAPAGO: DateTime read GetFECHAPAGOValue write SetFECHAPAGOValue; property IMPORTETOTAL: Currency read GetIMPORTETOTALValue write SetIMPORTETOTALValue; property CODIGOPRESUPUESTO: Integer read GetCODIGOPRESUPUESTOValue write SetCODIGOPRESUPUESTOValue; property REFERENCIAPRESUPUESTO: String read GetREFERENCIAPRESUPUESTOValue write SetREFERENCIAPRESUPUESTOValue; end; { TALBARANESCOMISIONDataTableRules } TALBARANESCOMISIONDataTableRules = class(TDADataTableRules, IALBARANESCOMISION) private protected { Property getters and setters } function GetSELECCIONValue: Integer; virtual; procedure SetSELECCIONValue(const aValue: Integer); virtual; function GetCODIGOEMPRESAValue: Integer; virtual; procedure SetCODIGOEMPRESAValue(const aValue: Integer); virtual; function GetCODIGOValue: Integer; virtual; procedure SetCODIGOValue(const aValue: Integer); virtual; function GetREFERENCIAValue: String; virtual; procedure SetREFERENCIAValue(const aValue: String); virtual; function GetCODIGOCONTACTOValue: Integer; virtual; procedure SetCODIGOCONTACTOValue(const aValue: Integer); virtual; function GetNOMBREValue: String; virtual; procedure SetNOMBREValue(const aValue: String); virtual; function GetFECHAALBARANValue: DateTime; virtual; procedure SetFECHAALBARANValue(const aValue: DateTime); virtual; function GetSITUACIONValue: String; virtual; procedure SetSITUACIONValue(const aValue: String); virtual; function GetFECHAPAGOValue: DateTime; virtual; procedure SetFECHAPAGOValue(const aValue: DateTime); virtual; function GetIMPORTETOTALValue: Currency; virtual; procedure SetIMPORTETOTALValue(const aValue: Currency); virtual; function GetCODIGOPRESUPUESTOValue: Integer; virtual; procedure SetCODIGOPRESUPUESTOValue(const aValue: Integer); virtual; function GetREFERENCIAPRESUPUESTOValue: String; virtual; procedure SetREFERENCIAPRESUPUESTOValue(const aValue: String); virtual; { Properties } property SELECCION: Integer read GetSELECCIONValue write SetSELECCIONValue; property CODIGOEMPRESA: Integer read GetCODIGOEMPRESAValue write SetCODIGOEMPRESAValue; property CODIGO: Integer read GetCODIGOValue write SetCODIGOValue; property REFERENCIA: String read GetREFERENCIAValue write SetREFERENCIAValue; property CODIGOCONTACTO: Integer read GetCODIGOCONTACTOValue write SetCODIGOCONTACTOValue; property NOMBRE: String read GetNOMBREValue write SetNOMBREValue; property FECHAALBARAN: DateTime read GetFECHAALBARANValue write SetFECHAALBARANValue; property SITUACION: String read GetSITUACIONValue write SetSITUACIONValue; property FECHAPAGO: DateTime read GetFECHAPAGOValue write SetFECHAPAGOValue; property IMPORTETOTAL: Currency read GetIMPORTETOTALValue write SetIMPORTETOTALValue; property CODIGOPRESUPUESTO: Integer read GetCODIGOPRESUPUESTOValue write SetCODIGOPRESUPUESTOValue; property REFERENCIAPRESUPUESTO: String read GetREFERENCIAPRESUPUESTOValue write SetREFERENCIAPRESUPUESTOValue; public constructor Create(aDataTable: TDADataTable); override; destructor Destroy; override; end; { IVENDEDORESCOMISION } IVENDEDORESCOMISION = interface(IDAStronglyTypedDataTable) ['{A907F6C8-C590-4E35-A50F-74BDFF6DDFD4}'] { Property getters and setters } function GetVENDEDORValue: String; procedure SetVENDEDORValue(const aValue: String); function GetPORCENTAJEValue: Float; procedure SetPORCENTAJEValue(const aValue: Float); function GetCOMISIONValue: Float; procedure SetCOMISIONValue(const aValue: Float); { Properties } property VENDEDOR: String read GetVENDEDORValue write SetVENDEDORValue; property PORCENTAJE: Float read GetPORCENTAJEValue write SetPORCENTAJEValue; property COMISION: Float read GetCOMISIONValue write SetCOMISIONValue; end; { TVENDEDORESCOMISIONDataTableRules } TVENDEDORESCOMISIONDataTableRules = class(TDADataTableRules, IVENDEDORESCOMISION) private protected { Property getters and setters } function GetVENDEDORValue: String; virtual; procedure SetVENDEDORValue(const aValue: String); virtual; function GetPORCENTAJEValue: Float; virtual; procedure SetPORCENTAJEValue(const aValue: Float); virtual; function GetCOMISIONValue: Float; virtual; procedure SetCOMISIONValue(const aValue: Float); virtual; { Properties } property VENDEDOR: String read GetVENDEDORValue write SetVENDEDORValue; property PORCENTAJE: Float read GetPORCENTAJEValue write SetPORCENTAJEValue; property COMISION: Float read GetCOMISIONValue write SetCOMISIONValue; public constructor Create(aDataTable: TDADataTable); override; destructor Destroy; override; end; { ICOMISIONES } ICOMISIONES = interface(IDAStronglyTypedDataTable) ['{543C8E1B-F0F1-4E75-840D-F266D63D31A3}'] { Property getters and setters } function GetCOMISIONValue: Float; procedure SetCOMISIONValue(const aValue: Float); { Properties } property COMISION: Float read GetCOMISIONValue write SetCOMISIONValue; end; { TCOMISIONESDataTableRules } TCOMISIONESDataTableRules = class(TDADataTableRules, ICOMISIONES) private protected { Property getters and setters } function GetCOMISIONValue: Float; virtual; procedure SetCOMISIONValue(const aValue: Float); virtual; { Properties } property COMISION: Float read GetCOMISIONValue write SetCOMISIONValue; public constructor Create(aDataTable: TDADataTable); override; destructor Destroy; override; end; implementation uses Variants; { TALBARANESCOMISIONDataTableRules } constructor TALBARANESCOMISIONDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TALBARANESCOMISIONDataTableRules.Destroy; begin inherited; end; function TALBARANESCOMISIONDataTableRules.GetSELECCIONValue: Integer; begin result := DataTable.Fields[idx_ALBARANESCOMISIONSELECCION].AsInteger; end; procedure TALBARANESCOMISIONDataTableRules.SetSELECCIONValue(const aValue: Integer); begin DataTable.Fields[idx_ALBARANESCOMISIONSELECCION].AsInteger := aValue; end; function TALBARANESCOMISIONDataTableRules.GetCODIGOEMPRESAValue: Integer; begin result := DataTable.Fields[idx_ALBARANESCOMISIONCODIGOEMPRESA].AsInteger; end; procedure TALBARANESCOMISIONDataTableRules.SetCODIGOEMPRESAValue(const aValue: Integer); begin DataTable.Fields[idx_ALBARANESCOMISIONCODIGOEMPRESA].AsInteger := aValue; end; function TALBARANESCOMISIONDataTableRules.GetCODIGOValue: Integer; begin result := DataTable.Fields[idx_ALBARANESCOMISIONCODIGO].AsInteger; end; procedure TALBARANESCOMISIONDataTableRules.SetCODIGOValue(const aValue: Integer); begin DataTable.Fields[idx_ALBARANESCOMISIONCODIGO].AsInteger := aValue; end; function TALBARANESCOMISIONDataTableRules.GetREFERENCIAValue: String; begin result := DataTable.Fields[idx_ALBARANESCOMISIONREFERENCIA].AsString; end; procedure TALBARANESCOMISIONDataTableRules.SetREFERENCIAValue(const aValue: String); begin DataTable.Fields[idx_ALBARANESCOMISIONREFERENCIA].AsString := aValue; end; function TALBARANESCOMISIONDataTableRules.GetCODIGOCONTACTOValue: Integer; begin result := DataTable.Fields[idx_ALBARANESCOMISIONCODIGOCONTACTO].AsInteger; end; procedure TALBARANESCOMISIONDataTableRules.SetCODIGOCONTACTOValue(const aValue: Integer); begin DataTable.Fields[idx_ALBARANESCOMISIONCODIGOCONTACTO].AsInteger := aValue; end; function TALBARANESCOMISIONDataTableRules.GetNOMBREValue: String; begin result := DataTable.Fields[idx_ALBARANESCOMISIONNOMBRE].AsString; end; procedure TALBARANESCOMISIONDataTableRules.SetNOMBREValue(const aValue: String); begin DataTable.Fields[idx_ALBARANESCOMISIONNOMBRE].AsString := aValue; end; function TALBARANESCOMISIONDataTableRules.GetFECHAALBARANValue: DateTime; begin result := DataTable.Fields[idx_ALBARANESCOMISIONFECHAALBARAN].AsDateTime; end; procedure TALBARANESCOMISIONDataTableRules.SetFECHAALBARANValue(const aValue: DateTime); begin DataTable.Fields[idx_ALBARANESCOMISIONFECHAALBARAN].AsDateTime := aValue; end; function TALBARANESCOMISIONDataTableRules.GetSITUACIONValue: String; begin result := DataTable.Fields[idx_ALBARANESCOMISIONSITUACION].AsString; end; procedure TALBARANESCOMISIONDataTableRules.SetSITUACIONValue(const aValue: String); begin DataTable.Fields[idx_ALBARANESCOMISIONSITUACION].AsString := aValue; end; function TALBARANESCOMISIONDataTableRules.GetFECHAPAGOValue: DateTime; begin result := DataTable.Fields[idx_ALBARANESCOMISIONFECHAPAGO].AsDateTime; end; procedure TALBARANESCOMISIONDataTableRules.SetFECHAPAGOValue(const aValue: DateTime); begin DataTable.Fields[idx_ALBARANESCOMISIONFECHAPAGO].AsDateTime := aValue; end; function TALBARANESCOMISIONDataTableRules.GetIMPORTETOTALValue: Currency; begin result := DataTable.Fields[idx_ALBARANESCOMISIONIMPORTETOTAL].AsCurrency; end; procedure TALBARANESCOMISIONDataTableRules.SetIMPORTETOTALValue(const aValue: Currency); begin DataTable.Fields[idx_ALBARANESCOMISIONIMPORTETOTAL].AsCurrency := aValue; end; function TALBARANESCOMISIONDataTableRules.GetCODIGOPRESUPUESTOValue: Integer; begin result := DataTable.Fields[idx_ALBARANESCOMISIONCODIGOPRESUPUESTO].AsInteger; end; procedure TALBARANESCOMISIONDataTableRules.SetCODIGOPRESUPUESTOValue(const aValue: Integer); begin DataTable.Fields[idx_ALBARANESCOMISIONCODIGOPRESUPUESTO].AsInteger := aValue; end; function TALBARANESCOMISIONDataTableRules.GetREFERENCIAPRESUPUESTOValue: String; begin result := DataTable.Fields[idx_ALBARANESCOMISIONREFERENCIAPRESUPUESTO].AsString; end; procedure TALBARANESCOMISIONDataTableRules.SetREFERENCIAPRESUPUESTOValue(const aValue: String); begin DataTable.Fields[idx_ALBARANESCOMISIONREFERENCIAPRESUPUESTO].AsString := aValue; end; { TVENDEDORESCOMISIONDataTableRules } constructor TVENDEDORESCOMISIONDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TVENDEDORESCOMISIONDataTableRules.Destroy; begin inherited; end; function TVENDEDORESCOMISIONDataTableRules.GetVENDEDORValue: String; begin result := DataTable.Fields[idx_VENDEDORESCOMISIONVENDEDOR].AsString; end; procedure TVENDEDORESCOMISIONDataTableRules.SetVENDEDORValue(const aValue: String); begin DataTable.Fields[idx_VENDEDORESCOMISIONVENDEDOR].AsString := aValue; end; function TVENDEDORESCOMISIONDataTableRules.GetPORCENTAJEValue: Float; begin result := DataTable.Fields[idx_VENDEDORESCOMISIONPORCENTAJE].AsFloat; end; procedure TVENDEDORESCOMISIONDataTableRules.SetPORCENTAJEValue(const aValue: Float); begin DataTable.Fields[idx_VENDEDORESCOMISIONPORCENTAJE].AsFloat := aValue; end; function TVENDEDORESCOMISIONDataTableRules.GetCOMISIONValue: Float; begin result := DataTable.Fields[idx_VENDEDORESCOMISIONCOMISION].AsFloat; end; procedure TVENDEDORESCOMISIONDataTableRules.SetCOMISIONValue(const aValue: Float); begin DataTable.Fields[idx_VENDEDORESCOMISIONCOMISION].AsFloat := aValue; end; { TCOMISIONESDataTableRules } constructor TCOMISIONESDataTableRules.Create(aDataTable: TDADataTable); begin inherited; end; destructor TCOMISIONESDataTableRules.Destroy; begin inherited; end; function TCOMISIONESDataTableRules.GetCOMISIONValue: Float; begin result := DataTable.Fields[idx_COMISIONESCOMISION].AsFloat; end; procedure TCOMISIONESDataTableRules.SetCOMISIONValue(const aValue: Float); begin DataTable.Fields[idx_COMISIONESCOMISION].AsFloat := aValue; end; initialization RegisterDataTableRules(RID_ALBARANESCOMISION, TALBARANESCOMISIONDataTableRules); RegisterDataTableRules(RID_VENDEDORESCOMISION, TVENDEDORESCOMISIONDataTableRules); RegisterDataTableRules(RID_COMISIONES, TCOMISIONESDataTableRules); end.