protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);

            //Есть ли у сайта доступ к модулю
            if (!_Repository.ModuleAllowed(ControllerName))
            {
                Response.Redirect("/page/error/451");
            }

            //Шаблон
            ViewName = _Repository.GetModuleView(ControllerName, ActionName);
            if (string.IsNullOrEmpty(ViewName))
            {
                throw new Exception("Не указан шаблон представления для данного контроллера и метода");
            }

            model = new PuFrontModel()
            {
                LayoutInfo  = _layoutData,
                Breadcrumbs = _breadcrumb,
                PageName    = _pageName,
                User        = CurrentUser
            };
        }
Beispiel #2
0
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);

            //Есть ли у сайта доступ к модулю
            if (!_Repository.ModuleAllowed(ControllerName))
            {
                Response.Redirect("/Page/error/451");
            }

            model = new PuFrontModel()
            {
                LayoutInfo  = _layoutData,
                Breadcrumbs = _breadcrumb,
                PageName    = _pageName,
                User        = CurrentUser
            };
        }