示例#1
0
    protected void BindTreeView()
    {
        FunctionBLL bll = new FunctionBLL();
        IList<Function> list = bll.GetChildFunctionList("0",false);
        foreach (Function model in list)
        {
            string name = model.F_Name;
            string code = model.F_Code.ToString();
            TreeNode td = new TreeNode(name, code);

            td.SelectAction = TreeNodeSelectAction.None;
            td.Expanded = false;

            BindChildTree(td);
            tvModel.Nodes.Add(td);
        }
    }
示例#2
0
    protected void BindChildTree(TreeNode node)
    {
        string nodeid = node.Value;

        FunctionBLL bll = new FunctionBLL();
        IList<Function> list = bll.GetChildFunctionList(nodeid,false);
        if (list != null)
        {
            foreach (Function model in list)
            {
                string name = model.F_Name;
                string code = model.F_Code.ToString();
                TreeNode td = new TreeNode(name, code);
                td.SelectAction = TreeNodeSelectAction.None;
                td.Expanded = false;

                BindChildTree(td);
                node.ChildNodes.Add(td);

            }
        }
    }