// GET: Profile public ActionResult Index() { if (Session["Me"] != null) { getEmployeeData_Result Model = Session["Me"] as getEmployeeData_Result; ViewData.Model = Model; return(View(Model)); } else { return(RedirectToAction("Index", "Home")); } }
public ActionResult Index() { DB my = new DB(); string myNTID = PageExtensionMethods.getMyWindowsID().ToString(); //myNTID = "ktriv003"; getEmployeeData_Result Model = my.getEmployeeData(myNTID).FirstOrDefault(); Session["Me"] = Model; ViewData.Model = Model; if (Request.UrlReferrer != null) { var previousURL = Request.UrlReferrer.AbsoluteUri; Redirect(previousURL); } else { return(View(Model)); } return(null); }