示例#1
0
        public ActionResult UserSettings()
        {
            //check the settings for the Dashboard view

            var checkSettings = new CheckSettings();
            var settings      = checkSettings.GetSettings(User.Identity.Name);


            ViewBag.SettingsHideClosed     = checkSettings.HideClosed;
            ViewBag.SettingsIconType       = checkSettings.IconType;
            ViewBag.SettingsMiniMenu       = checkSettings.MiniMenu;
            ViewBag.SettingsQuickLinks     = checkSettings.QuickLinks;
            ViewBag.SettingsShowDashStages = checkSettings.ShowDashStages;

            return(PartialView("_layOutSettings"));
        }
示例#2
0
        public ActionResult DisplayMenu()
        {
            ViewBag.PassportOver   = 0;
            ViewBag.PassportNearly = 0;
            //check if there are any Staff Passports coming up for renewal.
            var staffPassportModels = db.StaffPassportModels.ToList();

            foreach (var passport in staffPassportModels)
            {
                var today      = DateTime.Today;
                var monthsDiff = (passport.ResearchPassportRenewal - today).Days;
                if (monthsDiff <= 90)
                {
                    ViewBag.PassportOver++;
                }
                else
                {
                    if (monthsDiff <= 180)
                    {
                        ViewBag.PassportNearly++;
                    }
                }
            }
            //check the settings for the Dashboard view

            var checkSettings = new CheckSettings();
            var settings      = checkSettings.GetSettings(User.Identity.Name);


            ViewBag.SettingsHideClosed     = checkSettings.HideClosed;
            ViewBag.SettingsIconType       = checkSettings.IconType;
            ViewBag.SettingsMiniMenu       = checkSettings.MiniMenu;
            ViewBag.SettingsQuickLinks     = checkSettings.QuickLinks;
            ViewBag.SettingsShowDashStages = checkSettings.ShowDashStages;
            return(PartialView("_layOutSideBar"));
        }