git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@807 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2008-12-19 17:04:38 +00:00
parent dfe63e8f2e
commit 51a087ba8f
6 changed files with 72 additions and 11 deletions

View File

@ -42,6 +42,7 @@ type
function GetAppSplashForm : IAppSplashForm; function GetAppSplashForm : IAppSplashForm;
procedure SetAppSplashForm (AAppSplashForm : IAppSplashForm); procedure SetAppSplashForm (AAppSplashForm : IAppSplashForm);
procedure SeleccionarEmpresa;
procedure CambiarEmpresa(const AIDEmpresa : Integer); procedure CambiarEmpresa(const AIDEmpresa : Integer);
procedure ShowSplashForm; procedure ShowSplashForm;
@ -118,6 +119,7 @@ type
procedure Run; procedure Run;
procedure Terminate; procedure Terminate;
procedure SeleccionarEmpresa;
procedure CambiarEmpresa(const AIDEmpresa : Integer); procedure CambiarEmpresa(const AIDEmpresa : Integer);
function GetModule(AModuleName: String): TModuleController; function GetModule(AModuleName: String): TModuleController;
@ -145,7 +147,7 @@ var
implementation implementation
uses uses
Dialogs, uDialogUtils, cxControls, uUsuariosViewRegister, Windows, Dialogs, JSDialog, JSDialogs, uDialogUtils, cxControls, uUsuariosViewRegister,
uEmpresasViewRegister, uAppInfoUtils, uDMBase; uEmpresasViewRegister, uAppInfoUtils, uDMBase;
procedure TAppFactuGES.CambiarEmpresa(const AIDEmpresa: Integer); procedure TAppFactuGES.CambiarEmpresa(const AIDEmpresa: Integer);
@ -340,6 +342,49 @@ begin
FDoMainFormEvent := AMainFormEvent; FDoMainFormEvent := AMainFormEvent;
end; end;
procedure TAppFactuGES.SeleccionarEmpresa;
var
JsDialog: TJSDialog;
AEmpresas: IBizEmpresa;
AEmpresasController: IEmpresasController;
begin
JsDialog := TJSDialog.Create(nil);
try
JsDialog.Content.Add('Selección de empresa');
JsDialog.Instruction.Text := 'Elija la empresa con la que desea trabajar.';
JsDialog.DialogOptions := [doCommandLinks, doModal];
JsDialog.ButtonBar.Buttons := [cbOk];
JsDialog.Width := 600;
//Añadimos las diferentes empresas que existan
AEmpresasController := TEmpresasController.Create;
AEmpresas := AEmpresasController.BuscarTodos;
AEmpresas.DataTable.Active := True;
AEmpresas.Datatable.First;
while not AEmpresas.Datatable.eof do
begin
with JsDialog.CustomButtons.Add do
begin
Caption := AEmpresas.NIF_CIF + ' - ' + AEmpresas.NOMBRE;
Value := AEmpresas.ID;
end;
AEmpresas.DataTable.Next;
end;
AEmpresas.DataTable.First;
if JsDialog.Execute <> IDCANCEL then
if JsDialog.CustomButtonResult > 0 then
CambiarEmpresa(JsDialog.CustomButtonResult);
finally
FreeAndNIL(JsDialog);
AEmpresasController:= NIL;
AEmpresas := NIL;
end;
end;
procedure TAppFactuGES.SetAppSplashForm(AAppSplashForm: IAppSplashForm); procedure TAppFactuGES.SetAppSplashForm(AAppSplashForm: IAppSplashForm);
begin begin
FAppSplashForm := AAppSplashForm; FAppSplashForm := AAppSplashForm;

View File

@ -300,7 +300,6 @@ object fPantallaPrincipal: TfPantallaPrincipal
object actMenuEmpresa: TAction object actMenuEmpresa: TAction
Category = 'Menus' Category = 'Menus'
Caption = 'Empresa' Caption = 'Empresa'
OnUpdate = actMenuComprasUpdate
end end
object actMenuInformes: TAction object actMenuInformes: TAction
Category = 'Menus' Category = 'Menus'
@ -593,8 +592,8 @@ object fPantallaPrincipal: TfPantallaPrincipal
Tag = 1000 Tag = 1000
Caption = 'Empresa' Caption = 'Empresa'
object Listadeempresas1_OLD: TMenuItem object Listadeempresas1_OLD: TMenuItem
Caption = 'Lista de empresas' Caption = 'Selecci'#243'n de empresas'
Visible = False OnClick = Listadeempresas1_OLDClick
end end
object N1_OLD: TMenuItem object N1_OLD: TMenuItem
Tag = 100 Tag = 100
@ -656,7 +655,7 @@ object fPantallaPrincipal: TfPantallaPrincipal
end end
object Informes1: TMenuItem object Informes1: TMenuItem
Tag = 6000 Tag = 6000
Caption = 'Informes' Action = actMenuInformes
end end
end end
object JvXPMenuItemPainter1: TJvXPMenuItemPainter object JvXPMenuItemPainter1: TJvXPMenuItemPainter

View File

@ -116,6 +116,7 @@ type
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure actMenuInformesExecute(Sender: TObject); procedure actMenuInformesExecute(Sender: TObject);
procedure Listadeempresas1_OLDClick(Sender: TObject);
private private
FContenido : TCustomEditor; FContenido : TCustomEditor;
procedure ShowEmbedded(AEditor : ICustomEditor); procedure ShowEmbedded(AEditor : ICustomEditor);
@ -128,7 +129,7 @@ type
//procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND; //procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;
protected protected
function GetWorkPanel : TWinControl; function GetWorkPanel : TWinControl;
procedure CreateParams(var Params: TCreateParams); override; procedure CreateParams(var Params: TCreateParams); override;
public public
function IsShortcut(var Message: TWMKey): Boolean; override; function IsShortcut(var Message: TWMKey): Boolean; override;
procedure OnWorkPanelChanged(AEditor : ICustomEditor); procedure OnWorkPanelChanged(AEditor : ICustomEditor);
@ -192,7 +193,10 @@ begin
WindowState := wsMaximized; WindowState := wsMaximized;
ClientWidth := Screen.Width; ClientWidth := Screen.Width;
ClientHeight := Screen.Height; ClientHeight := Screen.Height;
Refresh; Refresh;
//Sacamos la lista de empresas para que el usuario elija con la que va a trabajar
AppFactuGES.SeleccionarEmpresa;
end; end;
procedure TfPantallaPrincipal.RefrescarUI; procedure TfPantallaPrincipal.RefrescarUI;
@ -307,7 +311,8 @@ end;
procedure TfPantallaPrincipal.Informacindeempresa1Click(Sender: TObject); procedure TfPantallaPrincipal.Informacindeempresa1Click(Sender: TObject);
begin begin
AppFactuGES.EmpresasController.Ver(AppFactuGES.EmpresaActiva); if Assigned(AppFactuGES.EmpresaActiva) then
AppFactuGES.EmpresasController.Ver(AppFactuGES.EmpresaActiva);
end; end;
procedure TfPantallaPrincipal.InicializarUI; procedure TfPantallaPrincipal.InicializarUI;
@ -583,6 +588,11 @@ begin
RefrescarUI; RefrescarUI;
end; end;
procedure TfPantallaPrincipal.Listadeempresas1_OLDClick(Sender: TObject);
begin
AppFactuGES.SeleccionarEmpresa;
end;
procedure TfPantallaPrincipal.actConexionExecute(Sender: TObject); procedure TfPantallaPrincipal.actConexionExecute(Sender: TObject);
begin begin
dmConexion.ConfigurarConexion; dmConexion.ConfigurarConexion;

View File

@ -233,6 +233,7 @@ object PluginContactos: TPluginContactos
Caption = 'Empleados' Caption = 'Empleados'
ImageIndex = 2 ImageIndex = 2
OnExecute = actEmpleadosExecute OnExecute = actEmpleadosExecute
OnUpdate = actEmpleadosUpdate
end end
object actGruposCliente: TAction object actGruposCliente: TAction
Caption = 'Grupos de cliente' Caption = 'Grupos de cliente'

View File

@ -39,11 +39,12 @@ type
procedure actGruposClienteExecute(Sender: TObject); procedure actGruposClienteExecute(Sender: TObject);
procedure actGruposProveedorExecute(Sender: TObject); procedure actGruposProveedorExecute(Sender: TObject);
procedure actGruposEmpleadoExecute(Sender: TObject); procedure actGruposEmpleadoExecute(Sender: TObject);
procedure actEmpleadosUpdate(Sender: TObject);
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
end; end;
implementation implementation
{$R *.dfm} {$R *.dfm}
@ -53,7 +54,7 @@ uses
uClientesController, uProveedoresController, uEmpleadosController, uClientesController, uProveedoresController, uEmpleadosController,
uGruposClienteController, uBizGruposCliente, uGruposProveedorController, uGruposClienteController, uBizGruposCliente, uGruposProveedorController,
uBizGruposProveedor, uGruposEmpleadoController, uBizGruposEmpleado, uBizGruposProveedor, uGruposEmpleadoController, uBizGruposEmpleado,
uContactosViewRegister, uBizContactos; uContactosViewRegister, uBizContactos, uFactuGES_App;
function GetModule : TModuleController; function GetModule : TModuleController;
begin begin
@ -131,6 +132,11 @@ begin
AEmpleadosController.VerTodos(AEmpleados); AEmpleadosController.VerTodos(AEmpleados);
end; end;
procedure TPluginContactos.actEmpleadosUpdate(Sender: TObject);
begin
(Sender as TAction).Enabled := Assigned(AppFactuGES.EmpresaActiva);
end;
constructor TPluginContactos.Create(AOwner: TComponent); constructor TPluginContactos.Create(AOwner: TComponent);
begin begin
inherited; inherited;

View File

@ -22,7 +22,7 @@ inherited frViewProveedorDatosComerciales: TfrViewProveedorDatosComerciales
Height = 39 Height = 39
Caption = Caption =
'Puede indicar el d'#237'a del mes en el cual el proveedor realiza los' + 'Puede indicar el d'#237'a del mes en el cual el proveedor realiza los' +
' pagos.' ' cobros.'
Transparent = True Transparent = True
WordWrap = True WordWrap = True
end end