Esempio n. 1
0
        public IActionResult Index()
        {
            if (!Diverso.Acesso(HttpContext.Session.GetComplexData <Usuario>("UserData"), 4))
            {
                return(RedirectToAction("DeniedAccess", "Login"));
            }

            return(View(_contratoRepository.GetAll()));
        }
        public IActionResult Create()
        {
            if (!Diverso.Acesso(HttpContext.Session.GetComplexData <Usuario>("UserData"), 3))
            {
                return(RedirectToAction("DeniedAccess", "Login"));
            }

            ViewBag.ListaTipo = _tipoRepository.GetAllTipoDrop(3);
            return(View());
        }
Esempio n. 3
0
        public IActionResult Create()
        {
            if (!Diverso.Acesso(HttpContext.Session.GetComplexData <Usuario>("UserData"), 1))
            {
                return(RedirectToAction("DeniedAccess", "Login"));
            }

            ViewBag.Paginas = _usuarioPaginaRepository.Perfil();

            return(View());
        }
Esempio n. 4
0
        public IActionResult Delete(int?id)
        {
            if (!Diverso.Acesso(HttpContext.Session.GetComplexData <Usuario>("UserData"), 4))
            {
                return(RedirectToAction("DeniedAccess", "Login"));
            }

            //Delete
            if (id == null)
            {
                return(NotFound());
            }

            var _documento = _contratoRepository.GetById(id);

            if (_documento == null)
            {
                return(NotFound());
            }

            return(View(_documento));
        }
        public IActionResult Edit(int?id)
        {
            if (!Diverso.Acesso(HttpContext.Session.GetComplexData <Usuario>("UserData"), 2))
            {
                return(RedirectToAction("DeniedAccess", "Login"));
            }

            if (id == null)
            {
                return(NotFound());
            }

            var _documento = _documentoRepository.GetById(id);

            if (_documento == null)
            {
                return(NotFound());
            }

            ViewBag.ListaTipo = _tipoRepository.GetAllTipoDrop(1);
            return(View(_documento));
        }
Esempio n. 6
0
        public IActionResult Edit(int?id)
        {
            if (!Diverso.Acesso(HttpContext.Session.GetComplexData <Usuario>("UserData"), 1))
            {
                return(RedirectToAction("DeniedAccess", "Login"));
            }

            if (id == null)
            {
                return(NotFound());
            }

            var _usuario = _usuarioRepository.GetByIdUsuarioPerfil(id);

            if (_usuario == null)
            {
                return(NotFound());
            }

            ViewBag.Paginas = _usuarioPaginaRepository.Perfil(_usuario.ID);

            return(View(_usuario));
        }