void CreateNode2(BizNode OrNode) { if (OrNode == null) { return; } try { _dsDeptInfo2 = ServiceAgent.ExecuteDataSet(false, "CONIS_IBS", "USP_MM_MM02_SELECT_02", txtCOMPANYCD.EditValue, "2"); DataRow[] drs2 = _dsDeptInfo2.Tables[0].Select("LEVEL=0 AND BIZCD = '" + OrNode.BIZCD + "'", " RNKORDER ASC"); for (int i = 0; i < drs2.Length; i++) { DeptNode OrNode2 = new DeptNode(drs2[i]); OrNode.Nodes.Add(OrNode2); CreateNode3(OrNode2, _dsDeptInfo2); } } catch (Exception ex) { MessageAgent.MessageShow(MessageType.Error, ex.ToString()); } }
private void CreTree() { //string sIBS_CD = UserInfo.instance().IBS_CD; //string sORG_CD = string.Empty; //if (sIBS_CD == "IBS01") // sORG_CD = null; //else // sORG_CD = UserInfo.instance().IBS_CD; //부서정보 _dsDeptInfo = ServiceAgent.ExecuteDataSet(false, "CONIS_IBS", "USP_MM_MM02_SELECT_02", txtCOMPANYCD.EditValue, "1"); TreeNode rootNode = new TreeNode("사업장별 부서정보"); this.treeView1.Nodes.Add(rootNode); this.treeView1.ImageList = this.imgOrganList; //DataRow[] drs = _dsDeptInfo.Tables[0].Select("LEVEL=0", " RNKORDER ASC"); //DataRow[] drs = _dsDeptInfo.Tables[0].Select("GROUP BY '{0}','{1}', BIZCD, BIZCD_NM "); DataRow[] drs1 = _dsDeptInfo.Tables[0].Select(); //노드 생성하기 for (int i = 0; i < drs1.Length; i++) { BizNode Onode = new BizNode(drs1[i]); CreateNode2(Onode); rootNode.Nodes.Add(Onode); if (treeView1.Nodes.Count > 0) { treeView1.Nodes[0].Expand(); } } this.treeView1.EndUpdate(); //this.treeView1.ExpandAll(); }