private void button1_Click(object sender, EventArgs e) { try { // validation if (text产品编号.Text == "") { MessageBox.Show("请先选择一个产品!"); return; } if (proman.DelProduct(text产品编号.Text)) { MessageBox.Show("删除产品成功!"); updateDataView(); } else { MessageBox.Show("删除失败!"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }