private void btnXoa_Click(object sender, EventArgs e)
        {
            BEL.BEL_theloai theloai     = new BEL.BEL_theloai(txtMaTheLoai.Text, txtTenTheLoai.Text, false);
            BAL.BAL_theloai xulytheloai = new BAL.BAL_theloai();

            string[] arr = new string[dgvTheLoai.SelectedRows.Count];
            int      id  = 0;

            try
            {
                foreach (DataGridViewRow rows in dgvTheLoai.SelectedRows)
                {
                    arr[id++] = dgvTheLoai.Rows[rows.Index].Cells[0].Value.ToString();
                }

                DialogResult res = MessageBox.Show("Xát nhận xóa ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (res == DialogResult.Yes)
                {
                    if (!FormDangNhap.Nhanvien.Quan_ly)
                    {
                        foreach (DataGridViewRow item in dgvTheLoai.SelectedRows)
                        {
                            dgvTheLoai.Rows.RemoveAt(item.Index);
                        }
                    }
                }
                bool ketqua = xulytheloai.capnhat_tragthai(theloai);
                if (ketqua == false)
                {
                    MessageBox.Show("Lỗi này là của của chúng tôi không phải do bạn? ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    dgvTheLoai.DataSource = xulytheloai.getAll();
                    //xóa dòng cuối
                    dgvTheLoai.AllowUserToAddRows = false;
                }
            }
            catch (Exception err)
            {
                MessageBox.Show("Lỗi này là của của chúng tôi không phải do bạn? ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }


            if (FormDangNhap.Nhanvien.Quan_ly)
            {
                dgvTheLoai.DataSource = xulytheloai.getAll();
                rowtotheloai(0);
                btnKhoiPhuc.Visible = this.theloai.Da_xoa;
            }
            else
            {
                dgvTheLoai.DataSource = xulytheloai.getAllExist();
                rowtotheloai(0);
                dgvTheLoai.Columns[2].Visible = false;
            }
        }