public ActionResult Mainmenu() { ViewBag.sYear = Request["hidSurveyYear"]; _utils.SetMMSession(Request.Form["hidSurveyYear"]); if (!_utils.IsAuthorized()) { return(RedirectToAction("Index")); } if (Convert.ToBoolean(TempData["YearValid"]) || ViewBag.sYear != null) { ViewBag.sYear = (TempData["TaxYear"] ?? ViewBag.sYear) ?? Request["syear"].ToString(CultureInfo.InvariantCulture); var varMainmenu = _mainMenuRepository.FetchMainmenu(Session["LoginId"].ToString(), ViewBag.sYear); if (varMainmenu != null) { PropertyInfo pi = varMainmenu.GetType().GetProperty("OrdinanceCorrect"); Session["OrdinanceCorrect"] = (bool)(pi.GetValue(varMainmenu, null)); PropertyInfo piOne = varMainmenu.GetType().GetProperty("CertificationComplete"); Session["CertificationComplete"] = (bool)(piOne.GetValue(varMainmenu, null)); PropertyInfo piTwo = varMainmenu.GetType().GetProperty("AtCode"); Session["AtCode"] = piTwo.GetValue(varMainmenu, null); PropertyInfo piThree = varMainmenu.GetType().GetProperty("P2Complete"); Session["P2Complete"] = piThree.GetValue(varMainmenu, null); PropertyInfo piFour = varMainmenu.GetType().GetProperty("P3Complete"); Session["P3Complete"] = piFour.GetValue(varMainmenu, null); } Session["TaxYear"] = ViewBag.sYear ?? TempData["TaxYear"]; TempData["YearValid"] = null; TempData["TaxYear"] = null; return(View("Mainmenu", varMainmenu)); } if (!_utils.GetMmSession()) { return(_utils.GetMmSession() ? (ActionResult)View() : RedirectToAction("Dashboard")); } return(View()); }
public ActionResult Form1() { if (!_utils.IsAuthorized()) { return(_utils.IsAuthorized() ? (ActionResult)View() : RedirectToAction("Index", "Hm")); } if (!_utils.GetMmSession() && ViewBag.sYear == null) { return(_utils.GetMmSession() ? (ActionResult)View() : RedirectToAction("Dashboard", "Hm")); } var varActionName = RouteData.Values["action"].ToString(); ViewBag.ActName = varActionName; ViewBag.sYear = _utils.GetTaxyear(); TempData["YearValid"] = true; TempData["TaxYear"] = Session["TaxYear"].ToString(); var varFormOneResults = _formOneRepository.FetchFormOneData(Session["LoginId"].ToString(), _utils.GetTaxyear()); return(View("Form1", varFormOneResults)); }