/// <summary> /// 获取本逻辑类单例 /// </summary> /// <returns></returns> public static COMPONENT01Bll GetInstence() { if (_COMPONENT01Bll == null) { _COMPONENT01Bll = new COMPONENT01Bll(); } return(_COMPONENT01Bll); }
/// <summary> /// 绑定树节点2 /// </summary> /// <param name="Tree1"></param> public void BandTreeListShowCOM(FineUI.Tree Tree1, string COM_ID) { // 模拟从数据库返回数据表 DataTable table; DataSet dsCom = null; dsCom = (DataSet)SPs.Get_COMPONENT00List().ExecuteDataSet(); DataTable daCom01 = COMPONENT01Bll.GetInstence().GetCOMPONENT01Table(COM_ID); if (dsCom.Tables.Count > 0) { table = dsCom.Tables[0].Copy(); table.Merge(daCom01); } else { table = new DataTable(); } DataSet ds = new DataSet(); ds.Tables.Add(table); ds.Relations.Add("TreeRelation", ds.Tables[0].Columns["TREE_ID"], ds.Tables[0].Columns["PARENT_Id"], false); foreach (DataRow row in ds.Tables[0].Rows) { if (row.IsNull("PARENT_Id")) { FineUI.TreeNode node = new FineUI.TreeNode(); node.Text = row["TREE_NAME"].ToString(); node.Expanded = false; Tree1.Nodes.Add(node); ResolveSubTree(row, node); } } }