示例#1
0
        public static string BindLeftMenu(this HtmlHelper helper, List<System_Menu> DataSource,Dictionary<string,string> permissions)
        {
            ADOComm commInstance = new ADOComm();
            //权限过滤
            var IS_OPEN_PERMISSION = ConfigHelper.GetApp("IS_OPEN_PERMISSION");
            if (!string.IsNullOrEmpty(IS_OPEN_PERMISSION) && IS_OPEN_PERMISSION == "true")
            {

                DataSource = DataSource.Where(o => permissions.Keys.Contains(o.Menu_Code)).ToList();
            }

            StringBuilder sb = new StringBuilder();
            if (DataSource != null && DataSource.Count > 0)
            {
                sb.Append(LeftMenuMax(helper, DataSource));
            }
            return sb.ToString();
        }
示例#2
0
        /// <summary>
        /// 绑定左侧菜单
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="DataSource"></param>
        /// <returns></returns>
        public static string BindLeftMenu(this HtmlHelper helper, List<System_Menu> DataSource)
        {
            ADOComm commInstance = new ADOComm();
            //权限过滤
            var IS_OPEN_PERMISSION=ConfigHelper.GetApp("IS_OPEN_PERMISSION");
            //if (!string.IsNullOrEmpty(IS_OPEN_PERMISSION) && IS_OPEN_PERMISSION == "true")
            //{
            //    string[] array=commInstance.UserPermissionArray(SessionConfig.UserId());
            //    DataSource = DataSource.Where(o => array.Contains(o.Menu_Code)).ToList();
            //}

            StringBuilder sb = new StringBuilder();
            if (DataSource!=null && DataSource.Count>0)
            {
               sb.Append(LeftMenuMax(helper,DataSource));
            }
            return sb.ToString();
        }