Initial commit
This commit is contained in:
37
SIG.Web/AppCode/Models/Common/DbResult.cs
Normal file
37
SIG.Web/AppCode/Models/Common/DbResult.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace SIG.Web.AppCode.Models.Common
|
||||
{
|
||||
public sealed class DbResult<T>
|
||||
{
|
||||
public bool Success { get; private set; }
|
||||
public T Data { get; private set; }
|
||||
public string UserMessage { get; private set; }
|
||||
public string TechnicalMessage { get; private set; }
|
||||
public Exception Exception { get; private set; }
|
||||
|
||||
public static DbResult<T> Ok(T data)
|
||||
{
|
||||
return new DbResult<T>
|
||||
{
|
||||
Success = true,
|
||||
Data = data,
|
||||
UserMessage = string.Empty,
|
||||
TechnicalMessage = string.Empty,
|
||||
Exception = null
|
||||
};
|
||||
}
|
||||
|
||||
public static DbResult<T> Fail(string userMessage, string technicalMessage, Exception exception)
|
||||
{
|
||||
return new DbResult<T>
|
||||
{
|
||||
Success = false,
|
||||
Data = default(T),
|
||||
UserMessage = userMessage,
|
||||
TechnicalMessage = technicalMessage,
|
||||
Exception = exception
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
9
SIG.Web/AppCode/Models/Common/StoredProcedureResult.cs
Normal file
9
SIG.Web/AppCode/Models/Common/StoredProcedureResult.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace SIG.Web.AppCode.Models.Common
|
||||
{
|
||||
public sealed class StoredProcedureResult
|
||||
{
|
||||
public bool Return { get; set; }
|
||||
public int ErrorTipo { get; set; }
|
||||
public string ErrorMostrar { get; set; }
|
||||
}
|
||||
}
|
||||
11
SIG.Web/AppCode/Models/Security/LoginRequest.cs
Normal file
11
SIG.Web/AppCode/Models/Security/LoginRequest.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SIG.Web.AppCode.Models.Security
|
||||
{
|
||||
public sealed class LoginRequest
|
||||
{
|
||||
public string NombreUsuario { get; set; }
|
||||
public string Contrasena { get; set; }
|
||||
public string NombreDominio { get; set; }
|
||||
public string DireccionIP { get; set; }
|
||||
public string AgenteUsuario { get; set; }
|
||||
}
|
||||
}
|
||||
12
SIG.Web/AppCode/Models/Security/LoginResult.cs
Normal file
12
SIG.Web/AppCode/Models/Security/LoginResult.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using SIG.Web.AppCode.Session;
|
||||
namespace SIG.Web.AppCode.Models.Security
|
||||
{
|
||||
public sealed class LoginResult
|
||||
{
|
||||
public bool Exitoso { get; private set; }
|
||||
public string Mensaje { get; private set; }
|
||||
public UserSessionModel Usuario { get; private set; }
|
||||
public static LoginResult Ok(UserSessionModel usuario) { return new LoginResult { Exitoso = true, Usuario = usuario, Mensaje = string.Empty }; }
|
||||
public static LoginResult Fail(string mensaje) { return new LoginResult { Exitoso = false, Mensaje = mensaje }; }
|
||||
}
|
||||
}
|
||||
70
SIG.Web/AppCode/Models/Security/UserAdministrationModels.cs
Normal file
70
SIG.Web/AppCode/Models/Security/UserAdministrationModels.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
|
||||
namespace SIG.Web.AppCode.Models.Security
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class PublicRegistrationDraft
|
||||
{
|
||||
public string NombreUsuario { get; set; }
|
||||
public string CorreoElectronico { get; set; }
|
||||
public string Contrasena { get; set; }
|
||||
public string RFC { get; set; }
|
||||
public string RazonSocial { get; set; }
|
||||
public string NombreComercial { get; set; }
|
||||
public string Direccion { get; set; }
|
||||
public string NoExt { get; set; }
|
||||
public string NoInt { get; set; }
|
||||
public string Colonia { get; set; }
|
||||
public string Ciudad { get; set; }
|
||||
public int CveSATEstado { get; set; }
|
||||
public string Pais { get; set; }
|
||||
public string CP { get; set; }
|
||||
public string Telefono { get; set; }
|
||||
}
|
||||
|
||||
public sealed class UserAdministrationModel
|
||||
{
|
||||
public int CveUsuario { get; set; }
|
||||
public string NombreUsuario { get; set; }
|
||||
public string CorreoElectronico { get; set; }
|
||||
public int CveRol { get; set; }
|
||||
public string NombreRol { get; set; }
|
||||
public bool Activo { get; set; }
|
||||
public bool DebeCambiarContrasena { get; set; }
|
||||
public bool CorreoVerificado { get; set; }
|
||||
public DateTime FechaCreacion { get; set; }
|
||||
}
|
||||
|
||||
public sealed class RoleOptionModel
|
||||
{
|
||||
public int CveRol { get; set; }
|
||||
public string NombreRol { get; set; }
|
||||
public string Descripcion { get; set; }
|
||||
}
|
||||
|
||||
public sealed class StateOptionModel
|
||||
{
|
||||
public int CveEstado { get; set; }
|
||||
public string ClaveEstado { get; set; }
|
||||
public string NombreEstado { get; set; }
|
||||
}
|
||||
|
||||
public sealed class UserClientModel
|
||||
{
|
||||
public int CveUsuarioCliente { get; set; }
|
||||
public int CveUsuario { get; set; }
|
||||
public int CveCliente { get; set; }
|
||||
public string Nombre { get; set; }
|
||||
public string RFC { get; set; }
|
||||
public int Orden { get; set; }
|
||||
public bool EsPrincipal { get; set; }
|
||||
public bool Activo { get; set; }
|
||||
public bool ClienteActivo { get; set; }
|
||||
}
|
||||
|
||||
public sealed class RegistrationCreatedModel
|
||||
{
|
||||
public int CveUsuario { get; set; }
|
||||
public int CveCliente { get; set; }
|
||||
}
|
||||
}
|
||||
19
SIG.Web/AppCode/Models/Security/UserModel.cs
Normal file
19
SIG.Web/AppCode/Models/Security/UserModel.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
namespace SIG.Web.AppCode.Models.Security
|
||||
{
|
||||
public sealed class UserModel
|
||||
{
|
||||
public int CveUsuario { get; set; }
|
||||
public string NombreUsuario { get; set; }
|
||||
public string HashContrasena { get; set; }
|
||||
public string CorreoElectronico { get; set; }
|
||||
public int CveRol { get; set; }
|
||||
public string NombreRol { get; set; }
|
||||
public bool Activo { get; set; }
|
||||
public bool CorreoVerificado { get; set; }
|
||||
public bool DebeCambiarContrasena { get; set; } public int IntentosFallidosInicioSesion { get; set; }
|
||||
public DateTime? BloqueadoHasta { get; set; }
|
||||
public DateTime? FechaUltimoInicioSesion { get; set; }
|
||||
public DateTime? FechaUltimaConexion { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user