UsuarioActivo ahora es de tipo TBizUsuarios.

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@235 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
David Arranz 2008-01-15 18:26:46 +00:00
parent 9b53c49069
commit bea34d6306
2 changed files with 18 additions and 20 deletions

View File

@ -34,8 +34,8 @@ type
procedure SetMaxIntentosLogin(const Value: Integer);
property MaxIntentosLogin : Integer read GetMaxIntentosLogin write SetMaxIntentosLogin;
function GetCurrentUser: TUCCurrentUser;
property CurrentUser: TUCCurrentUser read GetCurrentUser;
function GetCurrentUser: IBizUsuario;
property CurrentUser: IBizUsuario read GetCurrentUser;
function GuardarPerfil(APerfil : IBizPerfilUsuario): Boolean;
function GuardarUsuario(AUser : IBizUsuario): Boolean;
@ -81,11 +81,11 @@ type
TUsuariosController = class(TControllerBase, IUsuariosController)
private
function Eliminar(const AIDUser: integer): Boolean;
procedure FiltrarEmpresa(AUsuario: IBizUsuario);
procedure FiltrarEmpresa(AUsuario: IBizUsuario);
protected
FDataModule : IDataModuleUsuarios;
FUserControl: TUserControl;
FCurrentUser : IBizUsuario;
function GetMaxIntentosLogin: Integer;
procedure SetMaxIntentosLogin(const Value: Integer);
@ -96,7 +96,7 @@ type
procedure AsignarDataModule;
procedure InicializarUserControl;
procedure ComprobarUsuarioInicial;
function GetCurrentUser: TUCCurrentUser;
function GetCurrentUser: IBizUsuario;
function AnadirUsuario(AUser : IBizUsuario): Boolean;
function ModificarUsuario(AUser : IBizUsuario): Boolean;
@ -155,7 +155,7 @@ type
property UserControl : TUserControl read FUserControl;
property MaxIntentosLogin : Integer read GetMaxIntentosLogin write SetMaxIntentosLogin;
property CurrentUser: TUCCurrentUser read GetCurrentUser;
property CurrentUser: IBizUsuario read GetCurrentUser;
property Criptografia: TUCCriptografia read GetCriptografia;
end;
@ -327,8 +327,8 @@ begin
if not Result then
begin
ComprobarUsuarioInicial;
Result := ComprobarUsuario(User, Password);
end;
Result := ComprobarUsuario(User, Password);
end;
end;
procedure TUsuariosController.ComprobarUsuarioInicial;
@ -341,6 +341,7 @@ end;
constructor TUsuariosController.Create;
begin
AsignarDataModule;
FCurrentUser := NIL;
FUserControl := TUserControl.Create(nil);
InicializarUserControl;
end;
@ -406,11 +407,6 @@ begin
inherited;
end;
function TUsuariosController.Eliminar(const AIDUser: integer): Boolean;
begin
//
end;
function TUsuariosController.EliminarPerfil(
APerfil: IBizPerfilUsuario): Boolean;
var
@ -488,9 +484,11 @@ begin
end;
end;
function TUsuariosController.GetCurrentUser: TUCCurrentUser;
function TUsuariosController.GetCurrentUser: IBizUsuario;
begin
Result := FUserControl.CurrentUser;
if not Assigned(FCurrentUser) or (FCurrentUser.ID <> FUserControl.CurrentUser.UserID) then
FCurrentUser := BuscarUsuario(FUserControl.CurrentUser.UserID);
Result := FCurrentUser;
end;
function TUsuariosController.GetMaxIntentosLogin: Integer;

View File

@ -27,7 +27,7 @@ type
function GetUsuariosController: IUsuariosController;
function GetAppName: String;
function GetAppVersion: String;
function GetUsuarioActivo: TUsuario;
function GetUsuarioActivo: IBizUsuario;
function GetEmpresaActiva: IBizEmpresa;
function GetModuleManager : THostManager;
function GetTerminated: Boolean;
@ -53,7 +53,7 @@ type
property AppName : String read GetAppName;
property MainForm : TCustomForm read GetMainForm;
property EmpresaActiva : IBizEmpresa read GetEmpresaActiva;
property UsuarioActivo : TUsuario read GetUsuarioActivo;
property UsuarioActivo : IBizUsuario read GetUsuarioActivo;
property EmpresasController : IEmpresasController read GetEmpresasController;
property UsuariosController : IUsuariosController read GetUsuariosController;
property AppSplashForm : IAppSplashForm read GetAppSplashForm write SetAppSplashForm;
@ -84,7 +84,7 @@ type
function GetUsuariosController: IUsuariosController;
function GetAppName: String;
function GetAppVersion: String;
function GetUsuarioActivo: TUsuario;
function GetUsuarioActivo: IBizUsuario;
function GetEmpresaActiva: IBizEmpresa;
function GetModuleManager : THostManager;
function GetTerminated: Boolean;
@ -121,7 +121,7 @@ type
property MainForm : TCustomForm read GetMainForm;
property EmpresaActiva : IBizEmpresa read GetEmpresaActiva;
property AppSplashForm : IAppSplashForm read GetAppSplashForm write SetAppSplashForm;
property UsuarioActivo : TUsuario read GetUsuarioActivo;
property UsuarioActivo : IBizUsuario read GetUsuarioActivo;
property EmpresasController : IEmpresasController read GetEmpresasController;
property UsuariosController : IUsuariosController read GetUsuariosController;
property ModuleManager : THostManager read GetModuleManager;
@ -259,7 +259,7 @@ begin
Result := FTerminated;
end;
function TAppFactuGES.GetUsuarioActivo: TUsuario;
function TAppFactuGES.GetUsuarioActivo: IBizUsuario;
begin
Result := UsuariosController.CurrentUser;
end;