private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { this.treeView1.Nodes.Clear(); string projectstr = this.comboBox1.Text.ToString(); TreeNode tn = new TreeNode(); sqlstr = "select distinct BLOCKNO from sp_spool_tab where flag = 'Y' and drawingno in (select drawing_no from PROJECT_DRAWING_TAB where ISSUED_TIME is not null AND Project_Id = (select T.ID from PROJECT_TAB T where T.NAME='" + projectstr + "') AND DOCTYPE_ID IN (7) AND DOCTYPE_ID != 71 AND LASTFLAG = 'Y' AND NEW_FLAG = 'Y' AND DELETE_FLAG = 'N')"; FillTreeViewFunction.FillTree(this.treeView1, sqlstr); foreach (TreeNode node in this.treeView1.Nodes) { sqlstr = "select distinct SYSTEMID from sp_spool_tab where projectid = '" + projectstr + "' and blockno = '" + node.Text.ToString() + "' and flag = 'Y'"; FillTreeViewFunction.FillTreeView(node, sqlstr); } }
private void ModifyDelInfoFrm_Load(object sender, EventArgs e) { sqlstr = " SELECT NAME FROM PLM.PROJECT_TAB WHERE STATUS='N' and ID NOT IN (76,81,82) and NAME IN (SELECT DISTINCT PROJECTID FROM SP_SPOOL_TAB WHERE FLAG = 'Y') ORDER BY NAME"; DataSet ds = new DataSet(); User.DataBaseConnect(sqlstr, ds); TreeNode tn; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { tn = new TreeNode(); tn.Text = ds.Tables[0].Rows[i][0].ToString(); treeView1.Nodes["PROJECTS"].Nodes.Add(tn); sqlstr = "select distinct drawingno from sp_spool_tab where projectid = '" + tn.Text + "' and flag = 'Y' and drawingno in (select drawing_no from PROJECT_DRAWING_TAB where ISSUED_TIME is not null)"; FillTreeViewFunction.FillTreeView(tn, sqlstr); } this.treeView1.Nodes[0].Expand(); ds.Dispose(); }