Exemplo n.º 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();
        }
Exemplo n.º 2
0
 public override void OnActionExecuted(ActionExecutedContext filterContext)
 {
     filterContext.Controller.ViewBag.Layout = Layouts.LayoutFor(SessionManager.Get <CurrentUser>());
     base.OnActionExecuted(filterContext);
 }