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)); }
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")); }