예제 #1
0
 public ActionResult CabecalhoRodape(CabecalhoViewModel model)
 {
     this.SaveHtml(this.Cabecalho, model.Cabecalho);
     this.SaveHtml(this.Rodape, model.Rodape);
     model.Sucesso = "block";
     model.Erro    = "none";
     return(View(model));
 }
예제 #2
0
 public ActionResult Documento(CabecalhoViewModel cab)
 {
     ViewBag.CabecalhoViewModel = cab;
     return(View());
 }
예제 #3
0
 public ActionResult Identificacao(CabecalhoViewModel cab)
 {
     ViewBag.CabecalhoViewModel = cab;
     return(View());
 }
예제 #4
0
        public Cabecalho()
        {
            InitializeComponent();

            BindingContext = new CabecalhoViewModel();
        }
예제 #5
0
        public ActionResult Index(NumeroDocSNCLavalin numeroDocSNCLavalin)
        {
            //var numeroDocSNCLavalin = projetoViewModel.NumeroDocSNCLavalin;

            //string guidDoc = "";
            string guidDoc = (string)Session["GuidDoc"];//projetoViewModel.GuidDocumento;

            CabecalhoViewModel cabecalho = null;

            bool existemRevisoesNaoConfimadas  = false; //projetoViewModel.ExistemRevisoesNaoConfimadas;
            bool existemRevisoesNesteDocumento = false; //projetoViewModel.ExistemRevisoesNesteDocumento;

            using (var contextoDoc = DIContainer.Instance.AppContainer.Resolve <AppServiceBase <ListaVerificacao> >())
            {
                contextoDoc.Start();
                var documento = contextoDoc.ReturnByGUID(guidDoc);
                //.GetByProperty("DOC_VERIFICADO", numeroDocSNCLavalin.ToString()).ToList().FirstOrDefault();



                //Session["LV"] = documento;

                cabecalho = new CabecalhoApp().GetCabecalhoViewModel(documento);

                existemRevisoesNaoConfimadas  = documento.ListaRevisoes.Distinct().ToList().Exists(x => x.CONFIRMADO == 0);
                existemRevisoesNesteDocumento = documento.ListaRevisoes.Distinct().ToList().Count > 0 ? true : false;

                //Session["LV"] = documento;

                //projetoViewModel = new ProjetoViewModel()
                //{
                //    GUID = guidprojeto,
                //    NUMERO = numeroProjeto,
                //    NumeroDocumentoCorrente = numeroDocSNCLavalin.ToString(),
                //    GuidDocumento = documento.GUID,
                //    ExistemRevisoesNaoConfimadas = existemRevisoesNaoConfimadas,
                //    ExistemRevisoesNesteDocumento = existemRevisoesNesteDocumento //,
                //                                                                  //Documento = documento
                //};

                //documentoEncontrado = true;
                guidDoc = documento.GUID;
            }


            ////////////////////////////////////////////////////////


            //bool existemRevisoesNaoConfimadas = projetoViewModel.ExistemRevisoesNaoConfimadas;
            //bool existemRevisoesNesteDocumento = projetoViewModel.ExistemRevisoesNesteDocumento;


            //string guidDoc = projetoViewModel.GuidDocumento;

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

            //

            var nivel = 3;

            //var guidTipoCorrente = projetoViewModel.GetGuidTipo();
            ViewBag.nivel = nivel;
            //ViewBag.guid = guidTipoCorrente;

            //var btns = new LayoutSession();
            //btns.SetDocumentoCarregado();

            //Session["BOTOES"] = btns;



            List <Revisao> listaRevisoes = null;

            bool isVerificador = false;



            isVerificador = getUsuario(login).ISVERIFICADOR == 1 ? true : false;
            //if (documentoEncontrado)
            //{
            if (!isVerificador)
            {
                TempData["LayoutUsuario"] = "_LayoutNoVerificador";
            }
            else
            {
                if (existemRevisoesNesteDocumento)
                {
                    if (existemRevisoesNaoConfimadas)
                    {
                        TempData["LayoutUsuario"] = "_LayoutAddRevisao";
                    }
                    else
                    {
                        TempData["LayoutUsuario"] = "_LayoutNoConfirm";
                    }
                }
                else
                {
                    TempData["LayoutUsuario"] = "_LayoutDocumentoNovo";
                }
            }



            return(RedirectToAction("IndexLD", "ListaDocumento", new { guidDocumento = guidDoc }));
            //}
            //else
            //{
            //    return PartialView("Index", projetoViewModel);
            //}
        }