UsuarioActivo ahora es de tipo TBizUsuario.
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@111 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
1c43e5f4fd
commit
fadd5fcda0
@ -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;
|
||||
@ -900,4 +898,4 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
end.
|
||||
@ -27,7 +27,7 @@ type
|
||||
function GetUsuariosController: IUsuariosController;
|
||||
function GetAppName: String;
|
||||
function GetAppVersion: String;
|
||||
function GetUsuarioActivo: TUsuario;
|
||||
function GetUsuarioActivo: IBizUsuario;
|
||||
function GetEmpresaActiva: IBizEmpresa;
|
||||
function GetEjercicioActivo: IBizEjercicio;
|
||||
function GetModuleManager : THostManager;
|
||||
@ -56,7 +56,7 @@ type
|
||||
property MainForm : TCustomForm read GetMainForm;
|
||||
property EmpresaActiva : IBizEmpresa read GetEmpresaActiva;
|
||||
property EjercicioActivo : IBizEjercicio read GetEjercicioActivo;
|
||||
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;
|
||||
@ -88,7 +88,7 @@ type
|
||||
function GetUsuariosController: IUsuariosController;
|
||||
function GetAppName: String;
|
||||
function GetAppVersion: String;
|
||||
function GetUsuarioActivo: TUsuario;
|
||||
function GetUsuarioActivo: IBizUsuario;
|
||||
function GetEmpresaActiva: IBizEmpresa;
|
||||
function GetEjercicioActivo: IBizEjercicio;
|
||||
function GetModuleManager : THostManager;
|
||||
@ -128,7 +128,7 @@ type
|
||||
property EmpresaActiva : IBizEmpresa read GetEmpresaActiva;
|
||||
property EjercicioActivo : IBizEjercicio read GetEjercicioActivo;
|
||||
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;
|
||||
@ -292,7 +292,7 @@ begin
|
||||
Result := FTerminated;
|
||||
end;
|
||||
|
||||
function TAppFactuGES.GetUsuarioActivo: TUsuario;
|
||||
function TAppFactuGES.GetUsuarioActivo: IBizUsuario;
|
||||
begin
|
||||
Result := UsuariosController.CurrentUser;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user