/// <summary> /// 构造功能节点 /// </summary> /// <param name="parent"></param> private void Buildfunc(TreeNode parent) { int menuid = int.Parse(parent.Tag.ToString()); DataTable dt = SysUserMgr.GetFuncList(menuid); if (dt != null) { for (int i = 0; i < dt.Rows.Count; i++) { TreeNode node = new TreeNode(); node.Text = dt.Rows[i][1].ToString(); node.Tag = dt.Rows[i][0].ToString(); parent.Nodes.Add(node); } } }
/// <summary> /// 构造树 /// </summary> /// <param name="parentNode"></param> /// <param name="parentid"></param> private void BuildTree(TreeNode parentNode, int parentid) { DataTable dt = SysUserMgr.GetFuncList(parentid); if (dt != null) { for (int i = 0; i < dt.Rows.Count; i++) { TreeNode node = new TreeNode(); node.Text = dt.Rows[i][1].ToString(); node.Tag = dt.Rows[i][0].ToString(); // node.Nodes.Add("正在加载..."); tvwFunc.Nodes.Add(node); this.Buildfunc(tvwFunc.Nodes[i]); this.tvwFunc.ExpandAll(); } } }