private void bntOK_Click(object sender, EventArgs e) { tbProPathClass tbCalss = new tbProPathClass(); tbProPathMenthod tbMenthod = new tbProPathMenthod(); if (textBox1.Text == "") { MessageBox.Show("名称:不能为空!", "提示"); } tbCalss.ProID = tbMenthod.tbProPathID(); tbCalss.ProName = textBox1.Text; tbCalss.ProPath = "0"; int intResult = tbMenthod.tbProPathMenthodAdd(tbCalss); if (intResult == 1) { MessageBox.Show("添加成功!"); frmtbProPath frm = (frmtbProPath)this.Owner; tbMenthod.filltbProPath(frm.treeView1, frm.imageList1); this.Close(); } else { MessageBox.Show("添加失败!"); } }