Пример #1
0
        public ActionResult Index()
        {
            if (!LoginController.IsSessionValid())
            {
                return(RedirectToAction("Login", "Login",
                                        new { returnUrl = System.Web.HttpContext.Current.Request.Url.PathAndQuery }));
            }

            return(View(GetTreeData(LoginController.GetSessionUser().UserId)));
        }
Пример #2
0
        public ActionResult Home()
        {
            if (!LoginController.IsSessionValid())
            {
                return(RedirectToAction("Login", "Login",
                                        new { returnUrl = System.Web.HttpContext.Current.Request.Url.PathAndQuery }));
            }
            User curUser = LoginController.GetSessionUser();

            //go to the tree view if it's a student
            if (curUser.UserType == UserType.Student)
            {
                return(RedirectToAction("Index"));
            }
            return(View(curUser));
        }