using Bootstrap.Security;
using Bootstrap.Security.DataAccess;
using Longbow.Cache;
using Longbow.Data;
using System.Collections.Generic;
using System.Linq;
namespace Bootstrap.DataAccess
{
///
/// 菜单操作类
///
public static class MenuHelper
{
///
/// 通过指定角色ID相关菜单缓存键值
///
public const string RetrieveMenusByRoleIdDataKey = "MenuHelper-RetrieveMenusByRoleId";
///
/// 通过当前用户获取所有菜单数据缓存键名称 "BootstrapMenu-RetrieveMenus"
///
public const string RetrieveMenusAll = DbHelper.RetrieveMenusAll;
///
/// 保存菜单
///
///
///
public static bool Save(BootstrapMenu p)
{
// 不允许保存系统菜单与前台演示系统的默认菜单
if (DictHelper.RetrieveSystemModel() && (p.Category == "0" || p.Application == "2")) return true;
var ret = DbContextManager.Create