Exemple #1
0
        public ActionResult Index(ViewModeOptionEnum viewMode, int?viewTime, int?orgMode, string orgOption)
        {
            viewTime = viewTime ?? 0;
            orgMode  = orgMode ?? 1;
            var cookie = new HttpCookie($"{Current.User.EmployeeId}_ViewMode", viewMode.ToString());

            cookie.Values["viewMode"]  = viewMode.ToString();
            cookie.Values["viewTime"]  = viewTime.ToString();
            cookie.Values["OrgMode"]   = orgMode.ToString();
            cookie.Values["orgOption"] = orgOption;
            cookie.Expires             = DateTime.Now.AddDays(1);
            Response.SetCookie(cookie);

            var model = new HomeModel(viewMode, viewTime, orgMode, orgOption);

            if (model.IsSmall)
            {
                return(View(Current.User.IsInAnyRole("Admin,ReleaseOfficial,GenericReleaseUser") ? "Manager" : (Current.User.IsInAnyRole("OrgManager") ? "OrgManager" : "Index"), model));
            }

            return(View(Current.User.IsInAnyRole("Admin,ReleaseOfficial,GenericReleaseUser") ? "ManagerLarge" : (Current.User.IsInAnyRole("OrgManager") ? "OrgManagerLarge" : "IndexLarge"), model));
        }
Exemple #2
0
        public ActionResult Index(ViewModeOptionEnum viewMode, bool showPublished, int?orgMode, string orgOption)
        {
            orgMode = orgMode ?? 1;
            var        view   = Config.User.IsInAnyRole("Admin,ReleaseOfficial,ReadAll") ? "Manager" : (Config.User.IsInAnyRole("OrgManager") ? "OrgManager" : "Index");
            HttpCookie cookie = new HttpCookie($"{UserObject.CurrentUser.EmployeeId}_ViewMode", viewMode.ToString());

            cookie.Values["ShowPublished"] = showPublished.ToString();
            cookie.Values["viewMode"]      = viewMode.ToString();
            cookie.Values["OrgMode"]       = orgMode.ToString();
            cookie.Values["orgOption"]     = orgOption;
            cookie.Expires = DateTime.Now.AddDays(1);
            Response.SetCookie(cookie);

            var model = new HomeModel(viewMode, showPublished, orgMode, orgOption);

            if (model.IsSmall)
            {
                return(View(Config.User.IsInAnyRole("Admin,ReleaseOfficial,ReadAll") ? "Manager" : (Config.User.IsInAnyRole("OrgManager") ? "OrgManager" : "Index"), model));
            }

            return(View(Config.User.IsInAnyRole("Admin,ReleaseOfficial,ReadAll") ? "ManagerLarge" : (Config.User.IsInAnyRole("OrgManager") ? "OrgManagerLarge" : "IndexLarge"), model));
        }