コード例 #1
0
        private void ButtonManageForm_Load(object sender, EventArgs e)
        {
            gv_module.AutoGenerateColumns = false;

            if (DesignMode)
            {
                return;
            }
            if (!string.IsNullOrWhiteSpace(DataBaseStaticConfig.Config.provider) &&
                !string.IsNullOrWhiteSpace(DataBaseStaticConfig.Config.username) &&
                !string.IsNullOrWhiteSpace(DataBaseStaticConfig.Config.dbaddr) &&
                !string.IsNullOrWhiteSpace(DataBaseStaticConfig.Config.dbname) &&
                !string.IsNullOrWhiteSpace(DataBaseStaticConfig.Config.userpwd))
            {
                _bll = new ModuleManageBLL();
                var list = _bll.GetTreeEntity();
                foreach (WdTreeNode item in list.Where(o => o.parentId == "0"))
                {
                    TreeNode node = new TreeNode();
                    node.Text = item.text;
                    node.Name = item.id.ToString();
                    tv_list.Nodes.Add(node);
                    bindnodes(node, list);
                    if (tv_list.Nodes.Count > 0)
                    {
                        tv_list.TopNode.Expand();
                    }
                }
            }
        }
コード例 #2
0
        private void TreeSearch_Load(object sender, EventArgs e)
        {
            _bll = new ModuleManageBLL();
            var list = _bll.GetTreeEntity();

            foreach (WdTreeNode item in list.Where(o => o.parentId == "0"))
            {
                TreeNode node = new TreeNode();
                node.Text = item.text;
                node.Name = item.id.ToString();
                tv_list.Nodes.Add(node);
                bindnodes(node, list);
            }
            tv_list.ExpandAll();
        }