Beispiel #1
0
 private void AddChildToTrvwBudget(TreeNode parentNode, IList <BudTask> budTaskList)
 {
     foreach (BudTask current in budTaskList)
     {
         TreeNode        treeNode       = new TreeNode(current.Name, current.Id);
         IList <BudTask> listByParentId = BudTask.GetListByParentId(current.Id);
         if (listByParentId.Count > 0)
         {
             this.AddChildToTrvwBudget(treeNode, listByParentId);
         }
         else
         {
             treeNode.ToolTip = treeNode.Text;
         }
         parentNode.ChildNodes.Add(treeNode);
     }
 }
Beispiel #2
0
    private void BindTrvwBudget()
    {
        this.trvwBudget.Nodes.Clear();
        string value = this.hdnProjectCode.Value;

        if (!string.IsNullOrEmpty(value))
        {
            IList <BudTask> firstLayerList = BudTask.GetFirstLayerList(value);
            foreach (BudTask current in firstLayerList)
            {
                TreeNode        treeNode       = new TreeNode(current.Name, current.Id);
                IList <BudTask> listByParentId = BudTask.GetListByParentId(treeNode.Value);
                if (listByParentId.Count > 0)
                {
                    this.AddChildToTrvwBudget(treeNode, listByParentId);
                }
                this.trvwBudget.Nodes.Add(treeNode);
            }
            this.trvwBudget.ExpandAll();
        }
    }