IList <SystemMenu> GetSystemMenus(string applicationName) { if (String.IsNullOrEmpty(applicationName)) { return(Menu.Menus); } else { SystemMenuLogic mlogic = new SystemMenuLogic(); var result = mlogic.GetMenus(applicationName); return(result); } }
public ActionResult UpdateFunctionCode(List <object[]> newFunctionCodes, string applicationName) { SystemMenuLogic logic = new SystemMenuLogic(); bool result = logic.UpdateFunctionCode(newFunctionCodes); IList <SystemMenu> menus = null; if (result) { //重置菜单缓存 Menu.ResetMenuCache(); menus = GetSystemMenus(applicationName); } return(Json(new { Result = result, Menus = menus })); }
public ActionResult CreateMenu(SystemMenu menu, string applicationName) { SystemMenuLogic logic = new SystemMenuLogic(); bool result = logic.CreateMenu(menu, applicationName); if (result) { if (String.IsNullOrEmpty(applicationName) || applicationName == Applications.ApplicationNameOfRole) { //重置菜单缓存 Menu.ResetMenuCache(); } } return(Json(new { Result = result, Data = menu })); }
public ActionResult DeleteMenu(Guid functionId, Guid menuId) { SystemMenuLogic logic = new SystemMenuLogic(); bool result = logic.DeleteMenu(functionId, menuId); if (result) { SystemMenu oldMenu = Menu.GetMenu(functionId); if (oldMenu != null) { Functions.RemoveFunctionCache(oldMenu.FunctionCode); } //重置菜单缓存 Menu.ResetMenuCache(); } return(Json(new { Result = result })); }
public ActionResult UpdateMenu(SystemMenu menu) { SystemMenuLogic logic = new SystemMenuLogic(); bool result = logic.UpdateMenu(menu); if (result) { SystemMenu oldMenu = Menu.GetMenu(menu.FunctionId); if (oldMenu != null && oldMenu.FunctionCode != menu.FunctionCode) { Functions.RemoveFunctionCache(oldMenu.FunctionCode); } //重置菜单缓存 Menu.ResetMenuCache(); } return(Json(new { Result = result, Data = menu })); }