private void btThemTK_Click(object sender, EventArgs e)
        {
            frmQuanLyTaiKhoan_ThemTK frm = new frmQuanLyTaiKhoan_ThemTK();

            frm.ShowDialog();
            KetNoiSQL.LoadDLQLTK(dataViewQLTK);
        }
        private void frmQuanLyTaiKhoan_Load(object sender, EventArgs e)
        {
            this.CenterToScreen();

            KetNoiSQL.LoadDLQLTK(dataViewQLTK);
            cbbTimKiemTK.Text = "Tài Khoản";
        }
        private void btXoaTK_Click(object sender, EventArgs e)
        {
            SqlConnection conn = SQLDatabase.GetDBConnection();

            conn.Open();
            try
            {
                if (MessageBox.Show("Bạn chắc chắn muốn xóa Tài Khoản đã chọn?", "THÔNG BÁO", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    int dem = 0;
                    foreach (DataGridViewRow row in dataViewQLTK.Rows)
                    {
                        if (row.Cells[0].Value != null)
                        {
                            if ((bool)row.Cells[0].Value == true)
                            {
                                dem++;
                                string     MaTaiKhoan     = row.Cells[1].Value.ToString();
                                string     sqldelete_QLTK = "DELETE FROM TAIKHOAN WHERE MATAIKHOAN = @TaiKhoan";
                                SqlCommand command1       = new SqlCommand(sqldelete_QLTK, conn);
                                command1.Parameters.AddWithValue("@TaiKhoan", MaTaiKhoan);
                                command1.ExecuteNonQuery();
                            }
                        }
                    }

                    if (dem == 0)
                    {
                        MessageBox.Show("Bạn chưa chọn Tài Khoản để xóa!", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        string strThongBao = "Xóa " + dem + " Tài Khoản thành công!";
                        MessageBox.Show(strThongBao, "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    KetNoiSQL.LoadDLQLTK(dataViewQLTK);
                }
            }
            catch
            {
                MessageBox.Show("Xóa không thành công\nBạn không thể xóa tài khoản của nhân viên đã có giao dịch", "CẢNH BÁO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                conn.Close();
            }
        }
        private void btSuaTK_Click(object sender, EventArgs e)
        {
            frmQuanLyTaiKhoan_SuaTK frm = new frmQuanLyTaiKhoan_SuaTK();

            try
            {
                int      CurentIndex = dataViewQLTK.CurrentCell.RowIndex;
                string   TaiKhoan    = Convert.ToString(dataViewQLTK.Rows[CurentIndex].Cells[1].Value.ToString());
                string   MatKhau     = Convert.ToString(dataViewQLTK.Rows[CurentIndex].Cells[2].Value.ToString());
                string   HoTen       = Convert.ToString(dataViewQLTK.Rows[CurentIndex].Cells[3].Value.ToString());
                string   NamSinh     = Convert.ToString(dataViewQLTK.Rows[CurentIndex].Cells[4].Value.ToString());
                string   SoDienThoai = Convert.ToString(dataViewQLTK.Rows[CurentIndex].Cells[5].Value.ToString());
                string   GioiTinh    = Convert.ToString(dataViewQLTK.Rows[CurentIndex].Cells[6].Value.ToString());
                string   DiaChi      = Convert.ToString(dataViewQLTK.Rows[CurentIndex].Cells[7].Value.ToString());
                string   LoaiTK      = Convert.ToString(dataViewQLTK.Rows[CurentIndex].Cells[8].Value.ToString());
                string   QuyenHan    = Convert.ToString(dataViewQLTK.Rows[CurentIndex].Cells[9].Value.ToString());
                string[] dt0         = NamSinh.Split(new char[] { ' ' });
                string   dt1         = dt0[0];

                frm.txtTaiKhoan.Text    = TaiKhoan;
                frm.txtMatKhau.Text     = MatKhau;
                frm.txtHoTen.Text       = HoTen;
                frm.dtNamSinh.Text      = dt1;
                frm.txtSoDienThoai.Text = SoDienThoai;
                frm.txtDiaChi.Text      = DiaChi;
                frm.cbbLoaiTK.Text      = LoaiTK;
                if (GioiTinh == "Nam")
                {
                    frm.rbNam.Checked = true;
                    frm.rbNu.Checked  = false;
                }
                else
                {
                    frm.rbNu.Checked  = true;
                    frm.rbNam.Checked = false;
                }

                foreach (char QH in QuyenHan)
                {
                    switch (QH)
                    {
                    case '1':
                        frm.cbQLTK.Checked = true;
                        break;

                    case '2':
                        frm.cbQLKH.Checked = true;
                        break;

                    case '3':
                        frm.cbQLTTG.Checked = true;
                        break;

                    case '4':
                        frm.cbQLBG.Checked = true;
                        break;

                    case '5':
                        frm.cbBCTK.Checked = true;
                        break;

                    default:
                        frm.cbQLTK.Checked  = false;
                        frm.cbQLKH.Checked  = false;
                        frm.cbQLTTG.Checked = false;
                        frm.cbQLBG.Checked  = false;
                        frm.cbBCTK.Checked  = false;
                        break;
                    }
                }



                frm.ShowDialog();
                KetNoiSQL.LoadDLQLTK(dataViewQLTK);
            }
            catch
            {
                MessageBox.Show("Không có Tài Khoản nào được chọn", "THÔNG BÁO", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }