示例#1
0
        public SelectSchoolViewModel(CurrentUser currentUser, string returnUrl)
        {
            if (currentUser == null) throw new ArgumentNullException("currentUser");
            
            Layout = Layouts.LayoutFor(currentUser);
            ReturnUrl = returnUrl;
            
            if(string.IsNullOrEmpty(ReturnUrl))
                ReturnUrl = "~/Home/Index";

            ApplicationId = currentUser.CurrentApplicationId();
            SchoolId = currentUser.CurrentSchoolId();

            ApplicationList = currentUser.Applications().ToSelectList(ApplicationId);
            SchoolList = currentUser.Schools().ToSelectList(SchoolId);
            IsCompanyUser = currentUser.UserTypeId().IsCompanyUser();
            IsSchoolUser = currentUser.UserTypeId().IsSchoolUser();
        }
 public override void OnActionExecuted(ActionExecutedContext filterContext)
 {
     filterContext.Controller.ViewBag.Layout = Layouts.LayoutFor(SessionManager.Get <CurrentUser>());
     base.OnActionExecuted(filterContext);
 }