Repository/impl/NavigationListRepository.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using DataBaseLibrary.Utility;
using Model;
using Repository.interfaces;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Repository.impl
{
    /// <summary>
    /// 
    /// </summary>
    public class NavigationListRepository : INavigationListRepository
    {
        #region 自定义变量
        ConvertJson ConJson = new ConvertJson();
        ICommonRepository CommBll = new CommonRepository();
        NavigationListModel model = new NavigationListModel();
        StringBuilder ChildID = new StringBuilder();
        IRoleModelInfoRepository RoleModelBll = new RoleModelInfoRepository();
        #endregion

        #region 获取导航根节点
        /// <summary>
        /// 获取导航信息
        /// </summary>
        /// <returns></returns>
        public string GetNavigationRoot(int RoleGroupID)
        {
            StringBuilder MenuContent = new StringBuilder();
            List<string> lst = new List<string>();
            lst.Add("id");
            lst.Add("Text");
            lst.Add("Attributes");
            lst.Add("ParID");
            lst.Add("Sort");
            lst.Add("IconCls");
            lst.Add("State");
            string RoleModelIDs = RoleModelBll.GetRoleModelIDByRoleGroupID(RoleGroupID);
            //RoleModelIDs = string.Empty;
            string SqlWhere = "State=1 and ParID=0 ";
            if (!string.IsNullOrEmpty(RoleModelIDs))
            {
                SqlWhere = string.Format("State=1 and ParID=0 and id in ({0})", RoleModelIDs);
            }
            DataTable dt = CommBll.GetList<NavigationListModel>(model, SqlWhere, lst, "Sort", DataBaseLibrary.Utility.CommonEnum.OrderType.ASC);
            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    MenuContent.AppendFormat("                <div title=\"{0}\" style=\"overflow: auto; padding: 1px; height: 50px;\"> \n", row["Text"]);
                    MenuContent.AppendFormat("                    <ul id=\"system{0}\" class=\"easyui-tree\" data-options=\"url:'/Ashx/NavigationList.ashx?Action=GetNavigationChild&ParID={0}&RoleGroupID={1}',animate:true\"></ul> \n", row["id"], RoleGroupID);
                    MenuContent.Append("                </div> \n");
                }
            }
            return MenuContent.ToString();
        }
        #endregion
后面还有 110 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。