protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            ViewBag.Version = WebConfigurationManager.AppSettings["AppVersion"];
            ViewBag.IsAdmin = AccountsHelper.IsAdmin(filterContext.HttpContext.User.Identity.Name);

            var mainMenu = new Dictionary<string, NavItem<string>>();
            foreach (var cat in _ctx.DContentCategories)
            {
                var navGroup = new NavItem<string>();
                navGroup.Title = cat.Title;
                navGroup.Url = cat.Route;
                foreach (var routeItem in _ctx.VRouteItems.Where(ri => ri.CategoryId == cat.Id).OrderBy(ri => ri.Position))
                {
                    navGroup.AddItem(routeItem.RouteTitle, routeItem.Route);
                }
                mainMenu[cat.Name] = navGroup;
            }

            ViewBag.MainMenu = mainMenu;

            _ctx.UpdateLastOnline(filterContext.HttpContext.User.Identity.Name, DateTime.UtcNow);
            base.OnActionExecuted(filterContext);
        }
Beispiel #2
0
        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            ViewBag.Version = WebConfigurationManager.AppSettings["AppVersion"];
            ViewBag.IsAdmin = AccountsHelper.IsAdmin(filterContext.HttpContext.User.Identity.Name);

            var mainMenu = new Dictionary <string, NavItem <string> >();

            foreach (var cat in _ctx.DContentCategories)
            {
                var navGroup = new NavItem <string>();
                navGroup.Title = cat.Title;
                navGroup.Url   = cat.Route;
                foreach (var routeItem in _ctx.VRouteItems.Where(ri => ri.CategoryId == cat.Id).OrderBy(ri => ri.Position))
                {
                    navGroup.AddItem(routeItem.RouteTitle, routeItem.Route);
                }
                mainMenu[cat.Name] = navGroup;
            }

            ViewBag.MainMenu = mainMenu;

            _ctx.UpdateLastOnline(filterContext.HttpContext.User.Identity.Name, DateTime.UtcNow);
            base.OnActionExecuted(filterContext);
        }