private void btn_khoiPhucTK_Click(object sender, EventArgs e) { if (dgview_khoiPhucTK.SelectedRowsCount == 0) { XtraMessageBox.Show("Chưa chọn đối tượng để khôi phục", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { DialogResult result = XtraMessageBox.Show("Bạn có muốn khôi phục tài khoản này?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (DialogResult.Yes == result) { int[] selectedRows = dgview_khoiPhucTK.GetSelectedRows(); foreach (int rowHandle in selectedRows) { if (rowHandle >= 0) { string manv = dgview_khoiPhucTK.GetRowCellValue(rowHandle, cl_manv).ToString(); string tenDangNhap = dgview_khoiPhucTK.GetRowCellValue(rowHandle, cl_tenDangNhap).ToString(); tkBUS.UpdateNVChuaCoTK(manv); tkBUS.RestoreTK(tenDangNhap); } LoadTKDaXoa(); } XtraMessageBox.Show("Khôi phục thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }