From d9295361dfbcb46986cda8790e64199b9a34549b Mon Sep 17 00:00:00 2001 From: roberto Date: Sun, 18 Nov 2007 20:08:55 +0000 Subject: [PATCH] =?UTF-8?q?Segundo=20y=20ultimo=20repaso=20de=20creaci?= =?UTF-8?q?=C3=B3n=20de=20editores=20de=20informes=20y=20objetos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@144 0c75b7a4-871f-7646-8a2f-f78d34cc349f --- .../Controller/uEmpresasController.pas | 28 +++++--- .../Controller/uUsuariosController.pas | 20 +++--- Source/Cliente/FactuGES.dproj | 8 --- .../uAlbaranesClienteController.pas | 26 ++++---- .../uAlbaranesClienteReportController.pas | 24 +++---- .../uArticulosAlbaranClienteController.pas | 27 ++++---- .../uAlbaranesProveedorController.pas | 26 ++++---- .../uAlbaranesProveedorReportController.pas | 30 +++++---- .../uArticulosAlbaranProveedorController.pas | 29 ++++---- .../Controller/uAlmacenesController.pas | 3 +- .../Controller/uArticulosController.pas | 26 +++++--- .../uBancaElectronicaController.pas | 41 ++++++------ .../uComisionesReportController.pas | 35 +++++----- .../uEtiquetasContactosReportController.pas | 12 ++-- .../uFichasEmpleadoReportController.pas | 33 +++++---- .../Controller/uProveedoresController.pas | 51 +++++++------- .../uArticulosFacturaClienteController.pas | 27 ++++---- .../Controller/uFacturasClienteController.pas | 25 ++++--- .../uFacturasClienteReportController.pas | 12 ++-- .../FacturasProveedor_controller.dproj | 17 +++-- .../uArticulosFacturaProveedorController.pas | 29 ++++---- .../uFacturasProveedorController.pas | 26 +++++--- .../uFacturasProveedorReportController.pas | 29 +++++--- .../uArticulosInventarioController.pas | 23 ++++--- .../Controller/uInventarioController.pas | 25 ++++--- .../uArticulosPedidoProveedorController.pas | 29 ++++---- .../uPedidosProveedorController.pas | 51 +++++++------- .../uPedidosProveedorReportController.pas | 30 +++++---- ...uArticulosPresupuestoClienteController.pas | 27 ++++---- .../uPresupuestosClienteController.pas | 26 ++++---- .../Controller/uRecibosClienteController.pas | 22 +++--- .../uRecibosProveedorController.pas | 63 +++++++++--------- .../uRecibosProveedorReportController.pas | 30 +++++---- .../uRemesasClienteReportController.pas | 30 +++++---- .../uRemesasProveedorReportController.pas | 29 +++++--- Source/Servidor/FactuGES_Server.RES | Bin 23212 -> 23212 bytes Source/Servidor/FactuGES_Server.rc | 2 +- 37 files changed, 529 insertions(+), 442 deletions(-) diff --git a/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas b/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas index 7e6cd9ec..662e8c76 100644 --- a/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas +++ b/Source/ApplicationBase/Empresas/Controller/uEmpresasController.pas @@ -204,7 +204,7 @@ procedure TEmpresasController.Ver(AEmpresa: IBizEmpresa); var AEditor : IEditorEmpresa; begin - AEditor := NIL; + AEditor := NIL; ShowHourglassCursor; try CreateEditor('EditorEmpresa', IEditorEmpresa, AEditor); @@ -224,15 +224,25 @@ end; procedure TEmpresasController.VerTodos(AEmpresas: IBizEmpresa); {var - AEditor : IEditorClientes;} + AEditor : IEditorEmpresas;} begin -{ CreateEditor('EditorEmpresas', IEditorClientes, AEditor); - with AEditor do - begin - Contactos := AContactos; - Controller := Self; - ShowEmbedded; - end;} +{ + AEditor := NIL; + ShowHourglassCursor; + try + CreateEditor('EditorEmpresas', IEditorClientes, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Contactos := AContactos; + Controller := Self; + ShowEmbedded; + end; + finally + AEditor := NIL; + HideHourglassCursor; + end; +} end; end. diff --git a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas index 66def87e..7d2af283 100644 --- a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas +++ b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas @@ -200,21 +200,17 @@ begin ShowHourglassCursor; try CreateEditor('EditorLogin', IEditorLogin, AEditor); - with AEditor do - Controller := Self; + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; + Result := (AEditor.ShowModal = mrOk); + Release; + end; finally + AEditor := NIL; HideHourglassCursor; end; - - if Assigned(AEditor) then - begin - try - Result := (AEditor.ShowModal = mrOk); - AEditor.Release; - finally - AEditor := NIL; - end; - end; end; end. diff --git a/Source/Cliente/FactuGES.dproj b/Source/Cliente/FactuGES.dproj index 9388df6d..15c8010b 100644 --- a/Source/Cliente/FactuGES.dproj +++ b/Source/Cliente/FactuGES.dproj @@ -58,14 +58,6 @@ - - - - - - - - ExpressPrinting System by Developer Express Inc. PluginSDK for Delphi 10 (Runtime) Microsoft Office 2000 Sample Automation Server Wrapper Components diff --git a/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas b/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas index b5fa328b..4c9b61ac 100644 --- a/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas +++ b/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteController.pas @@ -666,21 +666,23 @@ var AEditor : IEditorElegirAlbaranesCliente; begin Result := NIL; - - CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor); + ShowHourglassCursor; try - with AEditor do - begin - Controller := Self; - Albaranes := AAlbaran; - MultiSelect := AMultiSelect; - Mensaje := AMensaje; - if IsPositiveResult(ShowModal) then - Result := AlbaranesClienteSeleccionados; - Release; - end; + CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; + Albaranes := AAlbaran; + MultiSelect := AMultiSelect; + Mensaje := AMensaje; + if IsPositiveResult(ShowModal) then + Result := AlbaranesClienteSeleccionados; + Release; + end; finally AEditor := NIL; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteReportController.pas b/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteReportController.pas index c46e7c8d..fa80b1c4 100644 --- a/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteReportController.pas +++ b/Source/Modulos/Albaranes de cliente/Controller/uAlbaranesClienteReportController.pas @@ -72,9 +72,9 @@ begin if Assigned(AEditor) then with AEditor do begin - AEditor.LoadFromStream(AStream); - AEditor.Preview; - AEditor.Release; + LoadFromStream(AStream); + Preview; + Release; end; finally FreeAndNil(AStream); @@ -99,9 +99,9 @@ begin if Assigned(AEditor) then with AEditor do begin - AEditor.LoadFromStream(AStream); - AEditor.Print; - AEditor.Release; + LoadFromStream(AStream); + Print; + Release; end; finally FreeAndNil(AStream); @@ -126,9 +126,9 @@ begin if Assigned(AEditor) then with AEditor do begin - AEditor.LoadFromStream(AStream); - AEditor.Preview; - AEditor.Release; + LoadFromStream(AStream); + Preview; + Release; end; finally FreeAndNil(AStream); @@ -153,9 +153,9 @@ begin if Assigned(AEditor) then with AEditor do begin - AEditor.LoadFromStream(AStream); - AEditor.Print; - AEditor.Release; + LoadFromStream(AStream); + Print; + Release; end; finally FreeAndNil(AStream); diff --git a/Source/Modulos/Albaranes de cliente/Controller/uArticulosAlbaranClienteController.pas b/Source/Modulos/Albaranes de cliente/Controller/uArticulosAlbaranClienteController.pas index edc6fa96..fa1531ad 100644 --- a/Source/Modulos/Albaranes de cliente/Controller/uArticulosAlbaranClienteController.pas +++ b/Source/Modulos/Albaranes de cliente/Controller/uArticulosAlbaranClienteController.pas @@ -3,7 +3,7 @@ unit uArticulosAlbaranClienteController; interface uses - uDADataTable, uArticulosController, uBizArticulos; + uDADataTable, cxControls, uArticulosController, uBizArticulos; type IArticulosAlbaranClienteController = interface(IArticulosController) @@ -27,20 +27,23 @@ var AEditor : IEditorElegirArticulosAlbaranesCliente; begin Result := NIL; - CreateEditor('EditorElegirArticulosAlbaranesCliente', IEditorElegirArticulosAlbaranesCliente, AEditor); + ShowHourglassCursor; try - with AEditor do - begin - Controller := Self; - Articulos := AArticulos; - MultiSelect := AMultiSelect; - Mensaje := AMensaje; - if IsPositiveResult(ShowModal) then - Result := ArticulosSeleccionados; - Release; - end; + CreateEditor('EditorElegirArticulosAlbaranesCliente', IEditorElegirArticulosAlbaranesCliente, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; + Articulos := AArticulos; + MultiSelect := AMultiSelect; + Mensaje := AMensaje; + if IsPositiveResult(ShowModal) then + Result := ArticulosSeleccionados; + Release; + end; finally AEditor := NIL; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorController.pas b/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorController.pas index c439790f..c96df0d1 100644 --- a/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorController.pas +++ b/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorController.pas @@ -731,21 +731,23 @@ var AEditor : IEditorElegirAlbaranesProveedor; begin Result := NIL; - - CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor); + ShowHourglassCursor; try - with AEditor do - begin - Controller := Self; - Albaranes := AAlbaran; - MultiSelect := AMultiSelect; - Mensaje := AMensaje; - if IsPositiveResult(ShowModal) then - Result := AlbaranesProveedorSeleccionados; - Release; - end; + CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; + Albaranes := AAlbaran; + MultiSelect := AMultiSelect; + Mensaje := AMensaje; + if IsPositiveResult(ShowModal) then + Result := AlbaranesProveedorSeleccionados; + Release; + end; finally AEditor := NIL; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorReportController.pas b/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorReportController.pas index 4234631a..d8c36da4 100644 --- a/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorReportController.pas +++ b/Source/Modulos/Albaranes de proveedor/Controller/uAlbaranesProveedorReportController.pas @@ -59,22 +59,25 @@ var AEditor : IEditorAlbaranesProveedorPreview; begin AEditor := NIL; - ShowHourglassCursor; try AStream := FDataModule.GetReport(AID); try CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor); - AEditor.LoadFromStream(AStream); + if Assigned(AEditor) then + with AEditor do + begin + LoadFromStream(AStream); + Preview; + Release; + end; finally - AStream.Free; + FreeAndNil(AStream); + AEditor := Nil; end; finally HideHourglassCursor; end; - - if Assigned(AEditor) then - AEditor.Preview; end; procedure TAlbaranesProveedorReportController.Print(const AID : String); @@ -83,22 +86,25 @@ var AEditor : IEditorAlbaranesProveedorPreview; begin AEditor := NIL; - ShowHourglassCursor; try AStream := FDataModule.GetReport(AID); try CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor); - AEditor.LoadFromStream(AStream); + if Assigned(AEditor) then + with AEditor do + begin + LoadFromStream(AStream); + Print; + Release; + end; finally - AStream.Free; + FreeAndNil(AStream); + AEditor := Nil; end; finally HideHourglassCursor; end; - - if Assigned(AEditor) then - AEditor.Print end; end. diff --git a/Source/Modulos/Albaranes de proveedor/Controller/uArticulosAlbaranProveedorController.pas b/Source/Modulos/Albaranes de proveedor/Controller/uArticulosAlbaranProveedorController.pas index 8ca6fd07..f500c3f3 100644 --- a/Source/Modulos/Albaranes de proveedor/Controller/uArticulosAlbaranProveedorController.pas +++ b/Source/Modulos/Albaranes de proveedor/Controller/uArticulosAlbaranProveedorController.pas @@ -20,28 +20,31 @@ implementation { TArticulosAlbaranProveedorController } -uses Controls, uIEditorElegirArticulosAlbaranesProveedor, uIEditorElegirArticulos; +uses Controls, cxControls, uIEditorElegirArticulosAlbaranesProveedor, uIEditorElegirArticulos; function TArticulosAlbaranProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo; var AEditor : IEditorElegirArticulosAlbaranesProveedor; begin Result := NIL; - CreateEditor('EditorElegirArticulosAlbaranesProveedor', IEditorElegirArticulosAlbaranesProveedor, AEditor); + ShowHourglassCursor; try - with AEditor do - begin - Controller := Self; - Articulos := AArticulos; - Proveedor := AProveedor; - MultiSelect := AMultiSelect; - Mensaje := AMensaje; - if IsPositiveResult(ShowModal) then - Result := ArticulosSeleccionados; - Release; - end; + CreateEditor('EditorElegirArticulosAlbaranesProveedor', IEditorElegirArticulosAlbaranesProveedor, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; + Articulos := AArticulos; + Proveedor := AProveedor; + MultiSelect := AMultiSelect; + Mensaje := AMensaje; + if IsPositiveResult(ShowModal) then + Result := ArticulosSeleccionados; + Release; + end; finally AEditor := NIL; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Almacenes/Controller/uAlmacenesController.pas b/Source/Modulos/Almacenes/Controller/uAlmacenesController.pas index 671f6001..404890da 100644 --- a/Source/Modulos/Almacenes/Controller/uAlmacenesController.pas +++ b/Source/Modulos/Almacenes/Controller/uAlmacenesController.pas @@ -226,7 +226,7 @@ var begin AEditor := NIL; Result := NIL; - + ShowHourglassCursor; try CreateEditor('EditorListaAlmacenes', IEditorListaAlmacenes, AEditor); if Assigned(AEditor) then @@ -239,6 +239,7 @@ begin end; finally AEditor := NIL; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Articulos/Controller/uArticulosController.pas b/Source/Modulos/Articulos/Controller/uArticulosController.pas index 3abbf106..3411432c 100644 --- a/Source/Modulos/Articulos/Controller/uArticulosController.pas +++ b/Source/Modulos/Articulos/Controller/uArticulosController.pas @@ -436,6 +436,7 @@ begin ShowEmbedded; end; finally + AEditor := Nil; HideHourglassCursor; end; end; @@ -463,20 +464,23 @@ var AEditor : IEditorElegirArticulos; begin Result := NIL; - CreateEditor('EditorElegirArticulos', IEditorElegirArticulos, AEditor); + ShowHourglassCursor; try - with AEditor do - begin - Controller := Self; - Articulos := AArticulos; - MultiSelect := AMultiSelect; - Mensaje := AMensaje; - if IsPositiveResult(ShowModal) then - Result := ArticulosSeleccionados; - Release; - end; + CreateEditor('EditorElegirArticulos', IEditorElegirArticulos, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; + Articulos := AArticulos; + MultiSelect := AMultiSelect; + Mensaje := AMensaje; + if IsPositiveResult(ShowModal) then + Result := ArticulosSeleccionados; + Release; + end; finally AEditor := NIL; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Banca electronica/Controller/uBancaElectronicaController.pas b/Source/Modulos/Banca electronica/Controller/uBancaElectronicaController.pas index e596d439..ab1b1509 100644 --- a/Source/Modulos/Banca electronica/Controller/uBancaElectronicaController.pas +++ b/Source/Modulos/Banca electronica/Controller/uBancaElectronicaController.pas @@ -185,31 +185,28 @@ begin ShowHourglassCursor; try CreateEditor('EditorExportacionNorma19', IEditorExportacionNorma19, AEditor); - with AEditor do - begin - CodigoEntidad := Entidad; - CodigoAgencia := Oficina; - FechaCargo := AFechaCargo; - Fichero := AFileName; - end; + if Assigned(AEditor) then + with AEditor do + begin + CodigoEntidad := Entidad; + CodigoAgencia := Oficina; + FechaCargo := AFechaCargo; + Fichero := AFileName; + + if (ShowModal = mrOk) then + begin + Entidad := CodigoEntidad; + Oficina := CodigoAgencia; + AFechaCargo := FechaCargo; + AFileName := Fichero; + Result := True; + end; + Release; + end; finally + AEditor := NIL; HideHourglassCursor; end; - - if Assigned(AEditor) then - try - if (AEditor.ShowModal = mrOk) then - begin - Entidad := AEditor.CodigoEntidad; - Oficina := AEditor.CodigoAgencia; - AFechaCargo := AEditor.FechaCargo; - AFileName := AEditor.Fichero; - Result := True; - end; - AEditor.Release; - finally - AEditor := NIL; - end; end; diff --git a/Source/Modulos/Comisiones/Controller/uComisionesReportController.pas b/Source/Modulos/Comisiones/Controller/uComisionesReportController.pas index 3032b1ac..20f8a757 100644 --- a/Source/Modulos/Comisiones/Controller/uComisionesReportController.pas +++ b/Source/Modulos/Comisiones/Controller/uComisionesReportController.pas @@ -59,23 +59,26 @@ var AEditor : IEditorComisionesPreview; begin AEditor := NIL; - ShowHourglassCursor; try AStream := FDataModule.GetReport(AComisionID, DesglosadoProv,'', '', Null); try CreateEditor('EditorComisionesPreview', IEditorComisionesPreview, AEditor); - AEditor.DataModule := FDataModule; - AEditor.LoadFromStream(AStream); + if Assigned(AEditor) then + with AEditor do + begin + DataModule := FDataModule; + LoadFromStream(AStream); + Preview; + Release; + end; finally - AStream.Free; + FreeAndNil(AStream); + AEditor := Nil; end; finally HideHourglassCursor; end; - - if Assigned(AEditor) then - AEditor.Preview; end; procedure TComisionesReportController.Print(const AComisionID : Variant; const DesglosadoProv: Boolean); @@ -84,23 +87,25 @@ var AEditor : IEditorComisionesPreview; begin AEditor := NIL; - ShowHourglassCursor; try - AStream := FDataModule.GetReport(AComisionID, DesglosadoProv, '', '', Null); + AStream := FDataModule.GetReport(AComisionID, DesglosadoProv, '', '', Null); try CreateEditor('EditorComisionesPreview', IEditorComisionesPreview, AEditor); - AEditor.DataModule := FDataModule; - AEditor.LoadFromStream(AStream); + if Assigned(AEditor) then + with AEditor do + begin + DataModule := FDataModule; + LoadFromStream(AStream); + Print; + end; finally - AStream.Free; + FreeAndNil(AStream); + AEditor := Nil; end; finally HideHourglassCursor; end; - - if Assigned(AEditor) then - AEditor.Print end; end. diff --git a/Source/Modulos/Contactos/Controller/uEtiquetasContactosReportController.pas b/Source/Modulos/Contactos/Controller/uEtiquetasContactosReportController.pas index 279bc14a..fe7e7aa9 100644 --- a/Source/Modulos/Contactos/Controller/uEtiquetasContactosReportController.pas +++ b/Source/Modulos/Contactos/Controller/uEtiquetasContactosReportController.pas @@ -65,9 +65,9 @@ begin if Assigned(AEditor) then with AEditor do begin - AEditor.LoadFromStream(AStream); - AEditor.Preview; - AEditor.Release; + LoadFromStream(AStream); + Preview; + Release; end; finally FreeAndNil(AStream); @@ -92,9 +92,9 @@ begin if Assigned(AEditor) then with AEditor do begin - AEditor.LoadFromStream(AStream); - AEditor.Print; - AEditor.Release; + LoadFromStream(AStream); + Print; + Release; end; finally FreeAndNil(AStream); diff --git a/Source/Modulos/Contactos/Controller/uFichasEmpleadoReportController.pas b/Source/Modulos/Contactos/Controller/uFichasEmpleadoReportController.pas index a0fd19bb..e8ec757a 100644 --- a/Source/Modulos/Contactos/Controller/uFichasEmpleadoReportController.pas +++ b/Source/Modulos/Contactos/Controller/uFichasEmpleadoReportController.pas @@ -57,22 +57,25 @@ var AEditor : IEditorFichasEmpleadoPreview; begin AEditor := NIL; - ShowHourglassCursor; try - AStream := FDataModule.GetReport(AFichaID); + AStream := FDataModule.GetReport(AFichaID); try CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor); - AEditor.LoadFromStream(AStream); + if Assigned(AEditor) then + with AEditor do + begin + LoadFromStream(AStream); + Preview; + Release; + end; finally - AStream.Free; + FreeAndNil(AStream); + AEditor := Nil; end; finally HideHourglassCursor; end; - - if Assigned(AEditor) then - AEditor.Preview; end; procedure TFichasEmpleadoReportController.Print(const AFichaID : String); @@ -84,19 +87,23 @@ begin ShowHourglassCursor; try - AStream := FDataModule.GetReport(AFichaID); + AStream := FDataModule.GetReport(AFichaID); try CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor); - AEditor.LoadFromStream(AStream); + if Assigned(AEditor) then + with AEditor do + begin + LoadFromStream(AStream); + Print; + Release; + end; finally - AStream.Free; + FreeAndNil(AStream); + AEditor := Nil; end; finally HideHourglassCursor; end; - - if Assigned(AEditor) then - AEditor.Print end; end. diff --git a/Source/Modulos/Contactos/Controller/uProveedoresController.pas b/Source/Modulos/Contactos/Controller/uProveedoresController.pas index 3744308a..67e6f344 100644 --- a/Source/Modulos/Contactos/Controller/uProveedoresController.pas +++ b/Source/Modulos/Contactos/Controller/uProveedoresController.pas @@ -89,44 +89,47 @@ var AEditor : IEditorElegirProveedores; begin Result := NIL; - - CreateEditor('EditorElegirProveedores', IEditorElegirProveedores, AEditor); + ShowHourglassCursor; try - with AEditor do - begin - Contactos := AContactos; - Controller := Self; - MultiSelect := AMultiSelect; - Mensaje := AMensaje; - if IsPositiveResult(ShowModal) then - Result := ContactosSeleccionados; - Release; - end; + CreateEditor('EditorElegirProveedores', IEditorElegirProveedores, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Contactos := AContactos; + Controller := Self; + MultiSelect := AMultiSelect; + Mensaje := AMensaje; + if IsPositiveResult(ShowModal) then + Result := ContactosSeleccionados; + Release; + end; finally AEditor := NIL; + HideHourglassCursor; end; end; -function TProveedoresController.ElegirDireccionEntrega( - ADirecciones: IBizDireccionesContacto; +function TProveedoresController.ElegirDireccionEntrega(ADirecciones: IBizDireccionesContacto; AMensaje: String): IBizDireccionesContacto; var AEditor : IEditorElegirDireccionEntrega; begin Result := NIL; - - CreateEditor('EditorElegirDireccionEntrega', IEditorElegirDireccionEntrega, AEditor); + ShowHourglassCursor; try - with AEditor do - begin - Direccion := ADirecciones; - Mensaje := AMensaje; - if IsPositiveResult(ShowModal) then - Result := DireccionSeleccionada; - Release; - end; + CreateEditor('EditorElegirDireccionEntrega', IEditorElegirDireccionEntrega, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Direccion := ADirecciones; + Mensaje := AMensaje; + if IsPositiveResult(ShowModal) then + Result := DireccionSeleccionada; + Release; + end; finally AEditor := NIL; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Facturas de cliente/Controller/uArticulosFacturaClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uArticulosFacturaClienteController.pas index a8cd9fb4..1ac9bd21 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uArticulosFacturaClienteController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uArticulosFacturaClienteController.pas @@ -19,7 +19,7 @@ implementation { TArticulosFacturaClienteController } -uses Controls, uIEditorElegirArticulosFacturasCliente, uIEditorElegirArticulos; +uses Controls, cxControls, uIEditorElegirArticulosFacturasCliente, uIEditorElegirArticulos; function TArticulosFacturaClienteController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String; AMultiSelect: Boolean): IBizArticulo; @@ -27,20 +27,23 @@ var AEditor : IEditorElegirArticulosFacturasCliente; begin Result := NIL; - CreateEditor('EditorElegirArticulosFacturaCliente', IEditorElegirArticulosFacturasCliente, AEditor); + ShowHourglassCursor; try - with AEditor do - begin - Controller := Self; - Articulos := AArticulos; - MultiSelect := AMultiSelect; - Mensaje := AMensaje; - if IsPositiveResult(ShowModal) then - Result := ArticulosSeleccionados; - Release; - end; + CreateEditor('EditorElegirArticulosFacturaCliente', IEditorElegirArticulosFacturasCliente, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; + Articulos := AArticulos; + MultiSelect := AMultiSelect; + Mensaje := AMensaje; + if IsPositiveResult(ShowModal) then + Result := ArticulosSeleccionados; + Release; + end; finally AEditor := NIL; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas index b4eb0ec9..6625da92 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteController.pas @@ -691,20 +691,23 @@ var AEditor : IEditorElegirFacturasCliente; begin Result := NIL; - CreateEditor('EditorElegirFacturasCliente', IEditorElegirFacturasCliente, AEditor); + ShowHourglassCursor; try - with AEditor do - begin - Controller := Self; - Facturas := AFacturas; - MultiSelect := AMultiSelect; - Mensaje := AMensaje; - if IsPositiveResult(ShowModal) then - Result := FacturasClienteSeleccionados; - Release; - end; + CreateEditor('EditorElegirFacturasCliente', IEditorElegirFacturasCliente, AEditor); + if Assigned(AEditor) then + with AEditor do + begin + Controller := Self; + Facturas := AFacturas; + MultiSelect := AMultiSelect; + Mensaje := AMensaje; + if IsPositiveResult(ShowModal) then + Result := FacturasClienteSeleccionados; + Release; + end; finally AEditor := NIL; + HideHourglassCursor; end; end; diff --git a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas index 11783a4c..fd029af2 100644 --- a/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas +++ b/Source/Modulos/Facturas de cliente/Controller/uFacturasClienteReportController.pas @@ -68,9 +68,9 @@ begin if Assigned(AEditor) then with AEditor do begin - AEditor.LoadFromStream(AStream); - AEditor.Preview; - AEditor.Release; + LoadFromStream(AStream); + Preview; + Release; end; finally FreeAndNil(AStream); @@ -95,9 +95,9 @@ begin if Assigned(AEditor) then with AEditor do begin - AEditor.LoadFromStream(AStream); - AEditor.Print; - AEditor.Release; + LoadFromStream(AStream); + Print; + Release; end; finally FreeAndNil(AStream); diff --git a/Source/Modulos/Facturas de proveedor/Controller/FacturasProveedor_controller.dproj b/Source/Modulos/Facturas de proveedor/Controller/FacturasProveedor_controller.dproj index c1bd8f33..33722ea2 100644 --- a/Source/Modulos/Facturas de proveedor/Controller/FacturasProveedor_controller.dproj +++ b/Source/Modulos/Facturas de proveedor/Controller/FacturasProveedor_controller.dproj @@ -48,14 +48,14 @@ MainSource - - - - - - - - + + + + + + + + @@ -66,7 +66,6 @@ -