Пример #1
0
        public virtual void Create()
        {
            IMenu menu = validateMenu(menuService.New());

            if (ctx.HasErrors)
            {
                echoError();
                return;
            }

            Result result = menuService.Insert(menu, (User)ctx.viewer.obj, ctx.owner.obj);

            if (result.HasErrors)
            {
                echoError(result);
                return;
            }

            log(SiteLogString.AddMenu(), menu);

            echoRedirect(lang("opok"), to(Index));
        }
Пример #2
0
        public virtual void SaveSubMenu(long id)
        {
            IMenu menu = validateMenu(menuService.New());

            if (ctx.HasErrors)
            {
                echoError();
                return;
            }

            menu.ParentId = id;

            Result result = menuService.Insert(menu, (User)ctx.viewer.obj, ctx.owner.obj);

            if (result.HasErrors)
            {
                echoError(result);
                return;
            }

            log(SiteLogString.AddMenu(), menu);

            echoToParentPart(lang("opok"));
        }