示例#1
0
        public ActionResult Details(Guid id)
        {
            Postagem post    = postagemServico.FindById(id);
            Eleitor  eleitor = (Eleitor)Session["SessionEleitor"];

            if (eleitor.EleitorId == post.EleitorId) // verifico se foi o eleitor q esta logado q criou esta postagem
            {
                ViewBag.Eleitor = true;              //se sim viewbag recebe true
            }
            else
            {
                ViewBag.Eleitor = false;
            }
            return(View(post));
        }