From 48df643567443a382981e6040f28c22d046684e4 Mon Sep 17 00:00:00 2001 From: roberto Date: Thu, 17 Dec 2009 16:08:35 +0000 Subject: [PATCH] Se adapta el programa para que multiempresa sea una variable de compilacion git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@984 0c75b7a4-871f-7646-8a2f-f78d34cc349f --- Source/ApplicationBase/uFactuGES_App.pas | 5 +++++ Source/Cliente/uNavPaneController.pas | 7 +++++++ Source/Cliente/uPantallaPrincipal.pas | 6 ++++++ Source/FactuGES.inc | 1 + 4 files changed, 19 insertions(+) create mode 100644 Source/FactuGES.inc diff --git a/Source/ApplicationBase/uFactuGES_App.pas b/Source/ApplicationBase/uFactuGES_App.pas index 80a70e16..c0940370 100644 --- a/Source/ApplicationBase/uFactuGES_App.pas +++ b/Source/ApplicationBase/uFactuGES_App.pas @@ -150,6 +150,7 @@ var AppFactuGES : IAppFactuGES = nil; implementation +{$INCLUDE ..\FactuGES.inc} uses Windows, Dialogs, JSDialog, JSDialogs, uDialogUtils, cxControls, uUsuariosViewRegister, @@ -400,9 +401,13 @@ begin end; AEmpresas.DataTable.First; + {$IFDEF MULTIEMPRESA} if JsDialog.Execute <> IDCANCEL then if JsDialog.CustomButtonResult > 0 then CambiarEmpresa(JsDialog.CustomButtonResult); + {$ELSE} + CambiarEmpresa(AEmpresas.ID); + {$ENDIF} finally FreeAndNIL(JsDialog); diff --git a/Source/Cliente/uNavPaneController.pas b/Source/Cliente/uNavPaneController.pas index 1bc4c3ad..0bcd3b2c 100644 --- a/Source/Cliente/uNavPaneController.pas +++ b/Source/Cliente/uNavPaneController.pas @@ -42,6 +42,7 @@ var NavPaneController : TNavPaneController; implementation +{$INCLUDE ..\FactuGES.inc} uses Dialogs, uModuleController, uAcercaDe, uNavPaneUtils, @@ -127,8 +128,11 @@ begin AEmpresas := AppFactuGES.EmpresasController.BuscarTodos; try AEmpresas.DataTable.Active := True; + + {$IFDEF MULTIEMPRESA} while not AEmpresas.DataTable.EOF do begin + {$ENDIF} // Buscar la página si existe AIndex := EncontrarPagina(FNavigationPane, AEmpresas.NOMBRE); @@ -163,8 +167,11 @@ begin ASeccion.Height := ASeccion.Height + ADivisor.Height; end; + {$IFDEF MULTIEMPRESA} AEmpresas.DataTable.Next; end; + {$ENDIF} + AEmpresas.DataTable.Active := False; finally AEmpresas := NIL; diff --git a/Source/Cliente/uPantallaPrincipal.pas b/Source/Cliente/uPantallaPrincipal.pas index 363ba2d1..333e3d22 100644 --- a/Source/Cliente/uPantallaPrincipal.pas +++ b/Source/Cliente/uPantallaPrincipal.pas @@ -142,6 +142,7 @@ var fPantallaPrincipal: TfPantallaPrincipal; implementation +{$INCLUDE ..\FactuGES.inc} uses uSplash, uAcercaDe, UxTheme, Themes, uMenuUtils, uBizEmpresas, @@ -477,6 +478,11 @@ constructor TfPantallaPrincipal.Create(AOwner: TComponent); begin inherited; + {$IFDEF MULTIEMPRESA} + {$ELSE} + Listadeempresas1_OLD.Destroy; + {$ENDIF} + FContenido := NIL; with AppFactuGES.ModuleManager do diff --git a/Source/FactuGES.inc b/Source/FactuGES.inc new file mode 100644 index 00000000..baf2b24e --- /dev/null +++ b/Source/FactuGES.inc @@ -0,0 +1 @@ +{$DEFINE MULTIEMPRESA} \ No newline at end of file