Пример #1
0
        public void InhabilitarRol(DtoRol dto)
        {
            var Rol = ObtenerRolId(dto.Id);

            Rol.Estado = Auditoria.EstadoInactivo;
            Actualizar(Rol);
        }
Пример #2
0
 Sg07_Rol MapearDtoAEntidad(DtoRol dto, string token)
 => new Sg07_Rol()
 {
     NombreRol       = dto.NombreRol,
     Estado          = dto.Estado,
     UsuarioCreacion = _sesionService.ObtenerUsuarioPorToken(token)?.NombreUsuario,
     FechaCreacion   = DateTime.Now,
 };
Пример #3
0
        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"));
        }
Пример #4
0
 public IActionResult Login(DtoRol rol)
 {
     if (ModelState.IsValid)
     {
         return(RedirectToAction("Index", "Home"));
     }
     else
     {
         return(RedirectToAction("Index"));
     }
 }
Пример #5
0
        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"));
            }
        }
Пример #6
0
        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);
        }
Пример #7
0
        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"));
            }
        }