public ActionResult Index() { try { using (CPMEntities data = new CPMEntities()) { var nombre = ""; int IdRoll = 0; foreach (f_EmpleadoRoll_Result f in data.f_EmpleadoRoll(Convert.ToInt32(Session["User"]))) { nombre = f.Nombre; IdRoll = (int)f.idRoll; } ViewBag.Message = nombre; Session["Nombre"] = nombre; Session["Roll"] = IdRoll; } return(View()); } catch (Exception ex) { throw new Exception(ex.Message); } }