private void button1_Click(object sender, EventArgs e) { if (this.txtname.Text == "") { MessageBox.Show("未插入数据"); } ///修改类别 // MessageBox.Show(Comm.TypeID); else { string name = this.txtname.Text; // Comm.TypeID; string id = Comm.TypeID; bool b = ProductTypeBLL.update(id, name); if (b == true) { MessageBox.Show("修改成功"); this.Close(); } else { MessageBox.Show("修改失败"); } } }