private void button1_Click(object sender, EventArgs e) { string name = this.txtRname.Text; string shu = this.txtcount.Text; if (name == "" && shu == "") { MessageBox.Show(this, "数据不能为空!", "提示"); return; } bool count = RoomTypeBLL.insert(name, shu); if (count == true) { MessageBox.Show("成功"); this.Close(); } else { MessageBox.Show("失败"); } }