private void btnXoaPhong_Click(object sender, EventArgs e) { if (txtMaPhong.Text != "" && txtTinhTrang.Text == "Trống") { PhongDTO infor = LayThongTinPhong(); DialogResult result = (MessageBox.Show("Bạn có muốn xóa phòng " + txtMaPhong.Text + " không?", "Hỏi", MessageBoxButtons.YesNo, MessageBoxIcon.Question)); if (result == DialogResult.Yes) { if (RoomBUS.XoaPhongTrongCTHoaDon(infor)) { if (RoomBUS.XoaPhong(infor)) { MessageBox.Show("Bạn đã xóa phòng " + txtMaPhong.Text + " thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); frmQuanLiPhong_Load(sender, e); KhoiTaoLai(); } } } } if (txtTinhTrang.Text == "Đầy") { MessageBox.Show("Không thể xóa phòng đang được đặt", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }