private void button1_Click(object sender, EventArgs e) { try { HoaDonObject hd = new HoaDonObject(); hd = get_data_hoadon1(); int a = hd_model.DatPhong(hd); if (a > 0) { MessageBox.Show("Đặt phòng thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Đặt phòng thất bại!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } DatPhong_Load(sender, e); } catch (Exception) { MessageBox.Show("Đặt phòng thất bại!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }