ASP.NET教务管理平台-权限及公共模块设计与开发

NJJ.TreeAndLog.TreeAndLogManage sm = new NJJ.TreeAndLog.TreeAndLogManage();

        DataTable dt = sm.GetTreeList("").Tables[0];

        this.listTarget.Items.Clear();

        //加载菜单选项到下拉列表中

        this.listTarget.Items.Add(new ListItem("根目录", "0"));

        DataRow[] drs = dt.Select("ParentID= " + 0);

        /循环读取,添加.

        foreach (DataRow r in drs)

        {

            string nodeid = r["NodeID"].ToString();

            string text = r["Text"].ToString();

            //string parentid=r["ParentID"].ToString();

            //string permissionid=r["PermissionID"].ToString();

            text = "╋" + text;

            this.listTarget.Items.Add(new ListItem(text, nodeid));

            int sonparentid = int.Parse(nodeid);

            string blank = "├";

            BindNode(sonparentid, dt, blank);

        }

        this.listTarget.DataBind();  绑定父类菜单

  /读取所有权限

       DataTable tabcategory = NJJ.Accounts.Bus.AccountsTool.GetAllCategories().Tables[0];

        int rc = tabcategory.Rows.Count;

        for (int n = 0; n < rc; n++)

        {

            string CategoryID = tabcategory.Rows[n]["CategoryID"].ToString();

            string CategoryName = tabcategory.Rows[n]["Description"].ToString();

            CategoryName = "╋" + CategoryName;

            this.listPermission.Items.Add(new ListItem(CategoryName, CategoryID));

            ///将权限绑定到下拉列表

            DataTable tabforums = NJJ.Accounts.Bus.AccountsTool.GetPermissionsByCategory(int.Parse(CategoryID)).Tables[0];

            int fc = tabforums.Rows.Count;

            for (int m = 0; m < fc; m++)

            {

                string ForumID = tabforums.Rows[m]["PermissionID"].ToString();

                string ForumName = tabforums.Rows[m]["Description"].ToString();

                ForumName = "  ├『" + ForumName + "』";

                this.listPermission.Items.Add(new ListItem(ForumName, ForumID));

            }

        }

        this.listPermission.DataBind();

        this.listPermission.Items.Insert(0, "--请选择--"); ///绑定权限

上一篇:3D建模在游戏行业的演变和影响


下一篇:Leetcode—2639. 查询网格图中每一列的宽度【简单】