Exemplo n.º 1
0
        public ActionResult Index()
        {
            string login = HttpContext.User.Identity.Name.Split('\\')[1].ToUpper();



            List <ProjetoViewModel> listalocal;

            var navegadorSession = new Navegador();

            Session["Nav"] = navegadorSession;

            ViewBag.SiglaUser        = login;
            Session["NivelCorrente"] = 0;
            ViewBag.Title            = "Projeto";

            Session["BOTOES"] = new LayoutSession();

            using (var contextoProjeto = DIContainer.Instance.AppContainer.Resolve <AppServiceBase <Projeto> >())
            {
                contextoProjeto.Start(); //_banco);

                var listaprojetos = contextoProjeto.Query().OrderBy(x => x.NUMERO).ToList();

                listalocal = Mapper.Map <IEnumerable <ProjetoViewModel> >(listaprojetos).ToList();
            }

            ViewBag.ListaProjetos = new SelectList(listalocal, "GUID", "NUMERO");

            TempData["LayoutUsuario"] = "_LayoutProjeto";
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult Index(int nivel, string guid)
        {
            Session["NivelCorrente"] = nivel;


            LayoutSession layoutSession = null;

            if (Session["BOTOES"] != null)
            {
                layoutSession = (LayoutSession)Session["BOTOES"];
            }


            string login = HttpContext.User.Identity.Name.Split('\\')[1].ToUpper();



            _navegadorSession = (Navegador)Session["Nav"];

            var numeroDocumento = string.Empty;

            if (Session["NumeroDocumento"] != null)
            {
                numeroDocumento = (string)Session["NumeroDocumento"];
            }


            _navegadorSession.OperaNivel(nivel, guid);

            if (nivel > 2)
            {
                if (_navegadorSession.PlanilhaEscolhida == null)
                {
                    ViewBag.DocumentoAtivado = false;

                    Session["NivelCorrente"] = nivel;
                    ViewBag.SiglaUser        = login;
                    return(View());
                }
                else if (_navegadorSession.PlanilhaEscolhida != null)
                {
                    if (string.IsNullOrEmpty(numeroDocumento))
                    {
                        ViewBag.DocumentoAtivado = false;
                        ViewBag.SiglaUser        = login;

                        return(RedirectToAction("IndexLT", "ListaTemplate", new { guidPlanilha = _navegadorSession.PlanilhaEscolhida.GUID }));
                    }
                    else
                    {
                        ViewBag.DocumentoAtivado = false;
                        ViewBag.SiglaUser        = login;

                        _navegadorSession.OperaNivel(nivel, guid);

                        //var usuario = getUsuario(login);
                        var isVerificador = getUsuario(login).GetBoolIsVerificador();


                        if (isVerificador)
                        {
                            TempData["LayoutUsuario"] = "_LayoutProjeto";
                            return(RedirectToAction("IndexLD", "ListaDocumento", new { guidDocumento = _navegadorSession.PlanilhaEscolhida.GUID }));
                        }
                        else
                        {
                            return(RedirectToAction("IndexLD", "ListaDocumento", new { guidDocumento = _navegadorSession.PlanilhaEscolhida.GUID }));
                        }
                    }
                }
            }
            else
            {
                ViewBag.DocumentoAtivado = false;

                Session["NivelCorrente"] = nivel;
                ViewBag.SiglaUser        = login;
                return(View());
            }


            return(View());
        }