From 5d3bb5aeb771fc9ca04985f178b5d9475c54646f Mon Sep 17 00:00:00 2001 From: david Date: Thu, 31 Jul 2008 10:10:52 +0000 Subject: [PATCH] Se repasan todos los validar de los controller para asegurarnos que se hace post del objeto de negocio, para evitar el problema que surge cuando solo ponemos el nombre y sin salir del campo damos a guardar git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@303 f4e31baf-9722-1c47-927c-6f952f962d4b --- .../Controller/uEjerciciosController.pas | 2 ++ .../Controller/uEmpresasController.pas | 2 ++ .../Controller/uAlmacenesController.pas | 10 +++++---- .../Controller/uApuntesController.pas | 2 ++ .../Controller/uAsientosController.pas | 2 ++ .../Controller/uBalancesController.pas | 2 ++ .../Controller/uCuentasController.pas | 2 ++ .../uCuentasEspecialesController.pas | 1 + .../Controller/uEpigrafesController.pas | 2 ++ .../Controller/uSubCuentasController.pas | 2 ++ .../Controller/uGruposClienteController.pas | 2 ++ .../Controller/uGruposProveedorController.pas | 2 ++ .../uProcedenciasClienteController.pas | 2 ++ .../Controller/uFamiliasController.pas | 16 ++++++++------ .../Controller/uFormasPagoController.pas | 2 ++ .../Controller/uTiposIVAController.pas | 2 ++ .../Controller/uUnidadesMedidaController.pas | 20 +++++++++++------- Source/Servidor/FactuGES_Server.RES | Bin 23352 -> 23344 bytes Source/Servidor/FactuGES_Server.dproj | 2 +- Source/Servidor/FactuGES_Server.rc | 10 ++++----- 20 files changed, 61 insertions(+), 24 deletions(-) diff --git a/Source/ApplicationBase/Ejercicios/Controller/uEjerciciosController.pas b/Source/ApplicationBase/Ejercicios/Controller/uEjerciciosController.pas index a5197fc6..c7175e00 100644 --- a/Source/ApplicationBase/Ejercicios/Controller/uEjerciciosController.pas +++ b/Source/ApplicationBase/Ejercicios/Controller/uEjerciciosController.pas @@ -201,6 +201,8 @@ end; function TEjerciciosController.ValidarEjercicio(AEjercicio: IBizEjercicio): Boolean; begin + Result := False; + if not Assigned(AEjercicio) then raise Exception.Create ('Ejercicio no asignado'); diff --git a/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas b/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas index 06471ca7..30e609cf 100644 --- a/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas +++ b/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas @@ -238,6 +238,8 @@ end; function TEmpresasController.ValidarEmpresa(AEmpresa: IBizEmpresa): Boolean; begin + Result := False; + if not Assigned(AEmpresa) then raise Exception.Create ('Empresa no asignada (ValidarEmpresa)'); diff --git a/Source/Modulos/Almacenes/Controller/uAlmacenesController.pas b/Source/Modulos/Almacenes/Controller/uAlmacenesController.pas index 315f5da2..394af6d4 100644 --- a/Source/Modulos/Almacenes/Controller/uAlmacenesController.pas +++ b/Source/Modulos/Almacenes/Controller/uAlmacenesController.pas @@ -179,6 +179,12 @@ function TAlmacenesController.ValidarAlmacen(AAlmacen: IBizAlmacen): Boolean; begin Result := False; + if not Assigned(AAlmacen) then + raise Exception.Create ('Alamcen no asignado'); + + if (AAlmacen.DataTable.State in dsEditModes) then + AAlmacen.DataTable.Post; + if Length(AAlmacen.NOMBRE) = 0 then raise Exception.Create('Debe indicar al menos el nombre de este almacén.'); @@ -186,7 +192,6 @@ begin AAlmacen.Edit; try AAlmacen.USUARIO := AppFactuGES.UsuarioActivo.UserName; - Result := True; finally AAlmacen.Post; @@ -365,9 +370,6 @@ begin begin ShowHourglassCursor; try - if (AAlmacen.DataTable.State in dsEditModes) then - AAlmacen.DataTable.Post; - // AsignarCodigo(AAlmacen); AAlmacen.DataTable.ApplyUpdates; diff --git a/Source/Modulos/Contabilidad/Controller/uApuntesController.pas b/Source/Modulos/Contabilidad/Controller/uApuntesController.pas index bcfccf2a..194ac2b5 100644 --- a/Source/Modulos/Contabilidad/Controller/uApuntesController.pas +++ b/Source/Modulos/Contabilidad/Controller/uApuntesController.pas @@ -233,6 +233,8 @@ function TApuntesController.ValidarApunte(AApunte: IBizApunte): Boolean; var Descuadre : Currency; begin + Result := False; + if not Assigned(AApunte) then raise Exception.Create ('Apuntes no asignados'); diff --git a/Source/Modulos/Contabilidad/Controller/uAsientosController.pas b/Source/Modulos/Contabilidad/Controller/uAsientosController.pas index ad2495cb..efc62c21 100644 --- a/Source/Modulos/Contabilidad/Controller/uAsientosController.pas +++ b/Source/Modulos/Contabilidad/Controller/uAsientosController.pas @@ -206,6 +206,8 @@ end; function TAsientosController.ValidarAsiento(AAsiento: IBizAsiento): Boolean; begin + Result := False; + if not Assigned(AAsiento) then raise Exception.Create ('Asiento no asignado'); diff --git a/Source/Modulos/Contabilidad/Controller/uBalancesController.pas b/Source/Modulos/Contabilidad/Controller/uBalancesController.pas index e282ff80..e45adbad 100644 --- a/Source/Modulos/Contabilidad/Controller/uBalancesController.pas +++ b/Source/Modulos/Contabilidad/Controller/uBalancesController.pas @@ -159,6 +159,8 @@ end; function TBalancesController.ValidarBalance(ABalance: IBizBalance): Boolean; begin + Result := False; + if not Assigned(ABalance) then raise Exception.Create ('Balance no asignado'); diff --git a/Source/Modulos/Contabilidad/Controller/uCuentasController.pas b/Source/Modulos/Contabilidad/Controller/uCuentasController.pas index 991ee5c9..ef3531e4 100644 --- a/Source/Modulos/Contabilidad/Controller/uCuentasController.pas +++ b/Source/Modulos/Contabilidad/Controller/uCuentasController.pas @@ -172,6 +172,8 @@ end; function TCuentasController.ValidarCuenta(ACuenta: IBizCuenta): Boolean; begin + Result := False; + if not Assigned(ACuenta) then raise Exception.Create ('Cuenta no asignado'); diff --git a/Source/Modulos/Contabilidad/Controller/uCuentasEspecialesController.pas b/Source/Modulos/Contabilidad/Controller/uCuentasEspecialesController.pas index dc3d85b8..9a547203 100644 --- a/Source/Modulos/Contabilidad/Controller/uCuentasEspecialesController.pas +++ b/Source/Modulos/Contabilidad/Controller/uCuentasEspecialesController.pas @@ -160,6 +160,7 @@ end; function TCuentasEspecialesController.ValidarCuentaEspecial(ACuentaEspecial: IBizCuentaEspecial): Boolean; begin + Result := False; if not Assigned(ACuentaEspecial) then raise Exception.Create ('CuentaEspecial no asignado'); diff --git a/Source/Modulos/Contabilidad/Controller/uEpigrafesController.pas b/Source/Modulos/Contabilidad/Controller/uEpigrafesController.pas index 5c67bfc6..3abf5193 100644 --- a/Source/Modulos/Contabilidad/Controller/uEpigrafesController.pas +++ b/Source/Modulos/Contabilidad/Controller/uEpigrafesController.pas @@ -180,6 +180,8 @@ end; function TEpigrafesController.ValidarEpigrafe(AEpigrafe: IBizEpigrafe): Boolean; begin + Result := False; + if not Assigned(AEpigrafe) then raise Exception.Create ('Epigrafe no asignado'); diff --git a/Source/Modulos/Contabilidad/Controller/uSubCuentasController.pas b/Source/Modulos/Contabilidad/Controller/uSubCuentasController.pas index 9edddd03..136c9988 100644 --- a/Source/Modulos/Contabilidad/Controller/uSubCuentasController.pas +++ b/Source/Modulos/Contabilidad/Controller/uSubCuentasController.pas @@ -386,6 +386,8 @@ end; function TSubCuentasController.ValidarSubCuenta(ASubCuenta: IBizSubCuenta): Boolean; begin + Result := False; + if not Assigned(ASubCuenta) then raise Exception.Create ('SubCuenta no asignado'); diff --git a/Source/Modulos/Contactos/Controller/uGruposClienteController.pas b/Source/Modulos/Contactos/Controller/uGruposClienteController.pas index d45a9631..c25db669 100644 --- a/Source/Modulos/Contactos/Controller/uGruposClienteController.pas +++ b/Source/Modulos/Contactos/Controller/uGruposClienteController.pas @@ -123,6 +123,8 @@ end; function TGruposClienteController.ValidarGrupoCliente(AGrupoCliente: IBizGrupoCliente): Boolean; begin + Result := False; + if not Assigned(AGrupoCliente) then raise Exception.Create ('GrupoCliente no asignada'); diff --git a/Source/Modulos/Contactos/Controller/uGruposProveedorController.pas b/Source/Modulos/Contactos/Controller/uGruposProveedorController.pas index 791a3bbd..f15f485b 100644 --- a/Source/Modulos/Contactos/Controller/uGruposProveedorController.pas +++ b/Source/Modulos/Contactos/Controller/uGruposProveedorController.pas @@ -123,6 +123,8 @@ end; function TGruposProveedorController.ValidarGrupoProveedor(AGrupoProveedor: IBizGrupoProveedor): Boolean; begin + Result := False; + if not Assigned(AGrupoProveedor) then raise Exception.Create ('GrupoProveedor no asignada'); diff --git a/Source/Modulos/Contactos/Controller/uProcedenciasClienteController.pas b/Source/Modulos/Contactos/Controller/uProcedenciasClienteController.pas index 8290aef9..f03d847d 100644 --- a/Source/Modulos/Contactos/Controller/uProcedenciasClienteController.pas +++ b/Source/Modulos/Contactos/Controller/uProcedenciasClienteController.pas @@ -123,6 +123,8 @@ end; function TProcedenciasClienteController.ValidarProcedenciaCliente(AProcedenciaCliente: IBizProcedenciaCliente): Boolean; begin + Result := False; + if not Assigned(AProcedenciaCliente) then raise Exception.Create ('ProcedenciaCliente no asignada'); diff --git a/Source/Modulos/Familias/Controller/uFamiliasController.pas b/Source/Modulos/Familias/Controller/uFamiliasController.pas index b584be81..2d279b4a 100644 --- a/Source/Modulos/Familias/Controller/uFamiliasController.pas +++ b/Source/Modulos/Familias/Controller/uFamiliasController.pas @@ -131,7 +131,15 @@ end; function TFamiliasController.ValidarAlmacen(AFamilia: IBizFamilia): Boolean; begin -// + Result := False; + + if not Assigned(AFamilia) then + raise Exception.Create ('Familia no asignada'); + + if (AFamilia.DataTable.State in dsEditModes) then + AFamilia.DataTable.Post; + + Result := True; end; procedure TFamiliasController.ValidarObjetos; @@ -193,7 +201,7 @@ begin Result := False; if not Assigned(AFamilia) then - raise Exception.Create ('Almacen no asignada'); + raise Exception.Create ('Familia no asignada'); ValidarObjetos; @@ -201,11 +209,7 @@ begin begin ShowHourglassCursor; try - if (AFamilia.DataTable.State in dsEditModes) then - AFamilia.DataTable.Post; - AFamilia.DataTable.ApplyUpdates; - Result := True; finally HideHourglassCursor; diff --git a/Source/Modulos/Formas de pago/Controller/uFormasPagoController.pas b/Source/Modulos/Formas de pago/Controller/uFormasPagoController.pas index cd522bd2..f20c72ab 100644 --- a/Source/Modulos/Formas de pago/Controller/uFormasPagoController.pas +++ b/Source/Modulos/Formas de pago/Controller/uFormasPagoController.pas @@ -177,6 +177,8 @@ end; function TFormasPagoController.ValidarFormaPago(AFormaPago: IBizFormaPago): Boolean; begin + Result := False; + if not Assigned(AFormaPago) then raise Exception.Create ('Forma de pago no asignada'); diff --git a/Source/Modulos/Tipos de IVA/Controller/uTiposIVAController.pas b/Source/Modulos/Tipos de IVA/Controller/uTiposIVAController.pas index 843b63f6..16eeab8c 100644 --- a/Source/Modulos/Tipos de IVA/Controller/uTiposIVAController.pas +++ b/Source/Modulos/Tipos de IVA/Controller/uTiposIVAController.pas @@ -212,6 +212,8 @@ end; function TTiposIVAController.ValidarTipoIVA(ATipoIVA: IBizTipoIVA): Boolean; begin + Result := False; + if not Assigned(ATipoIVA) then raise Exception.Create ('TipoIVA no asignado'); diff --git a/Source/Modulos/Unidades de medida/Controller/uUnidadesMedidaController.pas b/Source/Modulos/Unidades de medida/Controller/uUnidadesMedidaController.pas index eec7f264..62ff8789 100644 --- a/Source/Modulos/Unidades de medida/Controller/uUnidadesMedidaController.pas +++ b/Source/Modulos/Unidades de medida/Controller/uUnidadesMedidaController.pas @@ -27,7 +27,7 @@ type procedure RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); override; function CreateEditor(const AName : String; const IID: TGUID; out Intf): Boolean; - function ValidarAlmacen(AUnidadMedida: IBizUnidadMedida): Boolean; + function ValidarUnidadMedida(AUnidadMedida: IBizUnidadMedida): Boolean; //Estos son los tres métodos a sobre escribir si se desea heredar toda la logica de //este controller @@ -129,9 +129,17 @@ begin inherited; end; -function TUnidadesMedidaController.ValidarAlmacen(AUnidadMedida: IBizUnidadMedida): Boolean; +function TUnidadesMedidaController.ValidarUnidadMedida(AUnidadMedida: IBizUnidadMedida): Boolean; begin -// + Result := False; + + if not Assigned(AUnidadMedida) then + raise Exception.Create ('Unidad de medida no asignada'); + + if (AUnidadMedida.DataTable.State in dsEditModes) then + AUnidadMedida.DataTable.Post; + + Result := True; end; procedure TUnidadesMedidaController.ValidarObjetos; @@ -197,15 +205,11 @@ begin ValidarObjetos; - if ValidarAlmacen(AUnidadMedida) then + if ValidarUnidadMedida(AUnidadMedida) then begin ShowHourglassCursor; try - if (AUnidadMedida.DataTable.State in dsEditModes) then - AUnidadMedida.DataTable.Post; - AUnidadMedida.DataTable.ApplyUpdates; - Result := True; finally HideHourglassCursor; diff --git a/Source/Servidor/FactuGES_Server.RES b/Source/Servidor/FactuGES_Server.RES index 4fc887644d46227feebaed63408f5ed1edcbb779..dc077af168a7d6a35ca956378bc1e255fd36b5f0 100644 GIT binary patch delta 99 zcmdn7jd24I-HBi{nS3`w9!UO;Fy&-nU;;u02A0Xzk+O_aCPzjpGZsv)jcfw$x7xjWHP*DC}K!v$Y;o5NM$Hy&|y$uFlI2AygN#l*^+@_ I^2;c90E==Qm;e9( diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj index 3427a020..d40573b0 100644 --- a/Source/Servidor/FactuGES_Server.dproj +++ b/Source/Servidor/FactuGES_Server.dproj @@ -28,7 +28,7 @@ Delphi.Personality - FalseTrueFalseTrueFalse2230FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.2.3.0FactuGES (Servidor)2.2.3.0viernes, 23 de mayo de 2008 17:19 + FalseTrueFalseTrueFalse2240FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.2.4.0FactuGES (Servidor)2.2.4.0martes, 22 de julio de 2008 19:27 RemObjects Pascal Script - RemObjects SDK 3.0 Integration FactuGES_Server.dpr diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc index 0811847b..e9d1d545 100644 --- a/Source/Servidor/FactuGES_Server.rc +++ b/Source/Servidor/FactuGES_Server.rc @@ -1,7 +1,7 @@ MAINICON ICON "C:\Codigo Acana\Resources\Iconos\Servidor.ico" 1 VERSIONINFO -FILEVERSION 2,2,3,0 -PRODUCTVERSION 2,2,3,0 +FILEVERSION 2,2,4,0 +PRODUCTVERSION 2,2,4,0 FILEFLAGSMASK 0x3FL FILEFLAGS 0x00L FILEOS 0x40004L @@ -13,10 +13,10 @@ BEGIN BLOCK "0C0A04E4" BEGIN VALUE "CompanyName", "Rodax Software S.L.\0" - VALUE "FileVersion", "2.2.3.0\0" + VALUE "FileVersion", "2.2.4.0\0" VALUE "ProductName", "FactuGES (Servidor)\0" - VALUE "ProductVersion", "2.2.3.0\0" - VALUE "CompileDate", "miércoles, 30 de julio de 2008 12:09\0" + VALUE "ProductVersion", "2.2.4.0\0" + VALUE "CompileDate", "jueves, 31 de julio de 2008 12:02\0" END END BLOCK "VarFileInfo"