Ejemplo n.º 1
0
        private void btnXoaPhong_Click(object sender, EventArgs e)
        {
            if (txbSoPhong.Text == "")
            {
                MessageBox.Show("Bạn chưa nhập số phòng muốn xóa", "Xóa phòng", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            int soPhong = Convert.ToInt32(txbSoPhong.Text);

            if (MessageBox.Show("Bạn có chắc chắn muốn xóa số phòng này ?", "Xóa phòng", MessageBoxButtons.YesNo,
                                MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (phong.XoaPhongTrongTableDSPhong(soPhong))
                {
                    MessageBox.Show("Đã xóa phòng", "Xóa phòng", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Xóa phòng thất bại", "Xóa phòng", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
        }