public void InhabilitarRol(DtoRol dto) { var Rol = ObtenerRolId(dto.Id); Rol.Estado = Auditoria.EstadoInactivo; Actualizar(Rol); }
Sg07_Rol MapearDtoAEntidad(DtoRol dto, string token) => new Sg07_Rol() { NombreRol = dto.NombreRol, Estado = dto.Estado, UsuarioCreacion = _sesionService.ObtenerUsuarioPorToken(token)?.NombreUsuario, FechaCreacion = DateTime.Now, };
public DtoApiResponseMessage CrearRol(DtoRol dto, string token) { var Rol = MapearDtoAEntidad(dto, token); Crear(Rol); var dtoMapeado = MapearEntidadADto(Rol); return(_utilitarios.CrearDtoApiResponseMessage(dtoMapeado, "VE_SEG_CAR_001")); }
public IActionResult Login(DtoRol rol) { if (ModelState.IsValid) { return(RedirectToAction("Index", "Home")); } else { return(RedirectToAction("Index")); } }
public DtoApiResponseMessage ObtenerRolMedianteId(DtoRol dto) { var Rol = ObtenerRolId(dto.Id); if (Rol != null) { var dtoMapeado = MapearEntidadADto(Rol); return(_utilitarios.CrearDtoApiResponseMessage(dtoMapeado, "VE_SEG_CAR_004")); } else { return(_utilitarios.CrearDtoApiResponseMessage(null, "VE_SEG_CAR_007")); } }
IEnumerable <DtoRol> MapearEntidadADto(Sg07_Rol Rol) { DtoRol dto = new DtoRol(); dto.Id = Rol.Id;; dto.NombreRol = Rol.NombreRol; dto.UsuarioCreacion = Rol.UsuarioCreacion; dto.UsuarioModificacion = Rol.UsuarioModificacion; dto.Estado = Rol.Estado; List <DtoRol> lista = new List <DtoRol>(); lista.Add(dto); return(lista); }
public DtoApiResponseMessage ActualizarRol(DtoRol dto, string token) { var Rol = ObtenerRolId(dto.Id); if (Rol != null) { Rol.NombreRol = dto.NombreRol; Rol.FechaModificacion = DateTime.Now; Rol.UsuarioModificacion = _sesionService.ObtenerUsuarioPorToken(token)?.NombreUsuario; Actualizar(Rol); var dtoMapeado = MapearEntidadADto(Rol); return(_utilitarios.CrearDtoApiResponseMessage(dtoMapeado, "VE_SEG_CAR_002")); } else { return(_utilitarios.CrearDtoApiResponseMessage(null, "VE_SEG_CAR_007")); } }