• treeView


            /// <summary>
            /// 绑定父节点数据
            /// </summary>
            private void BindData()
            {
                //获取到父节点信息
                var parentNodes = ComRole.ComBill.GetDepartMentDendrogram(1, this.ComUserId);
                if (parentNodes.Any())
                {

                    foreach (var pNodes in parentNodes)
                    {
                        pNodes.ComUserInfo = new ComUserInfo();
                        TreeNode node = new TreeNode();
                        node.Text = pNodes.departmentName;
                        node.Value = pNodes.identify.ToString();
                        treeDepart.Nodes.Add(node);
                        BindChildData(node, Convert.ToInt64(pNodes.identify));
                    }
                }
                iframes.Attributes.Add("src", "ComDeptContentPage.aspx?id=170");
            }



            /// <summary>
            /// 绑定子节点
            /// </summary>
            /// <param name="parentId"></param>
            private void BindChildData(TreeNode nd, long parentId)
            {
                //获取子节点信息
                var childNodes = ComRole.ComBill.GetDepartMentDendrogram(parentId, this.ComUserId);
                if (childNodes.Any())
                {
                    foreach (var childNode in childNodes)
                    {
                        TreeNode tn = new TreeNode();
                        tn.Text = childNode.departmentName;
                        tn.Value = childNode.identify.ToString();
                        nd.ChildNodes.Add(tn);
                        BindChildData(tn, Convert.ToInt64(childNode.identify));
                    }
                }
            }

  • 相关阅读:
    sessionId在fragment里无法保存的问题
    android:ellipsize实现跑马灯效果总结(转)
    Android:TextView 自动滚动(跑马灯) (转)
    Failed to install on device ‘emulator-5554′: timeout
    一个类怎样引用另外一个类的成员变量或方法
    android.widget.RadioButton 单选按钮(转)
    如何实现两个Activity 之间如何通讯
    linux自学(八)之开始centos学习,安装tomcat
    linux自学(六)之开始centos学习,更换yum源
    linux自学(四)之开始centos学习,网络配置
  • 原文地址:https://www.cnblogs.com/Mancy/p/2504391.html
Copyright © 2020-2023  润新知