private void btnKhoiPhucKH_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Khôi phục khách hàng " + dgvKH["Tên khách hàng", dgvKH.CurrentRow.Index].Value.ToString() + "?", "THÔNG BÁO!", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { int rowIndex = dgvKH.CurrentRow.Index; string ma = dgvKH["Mã khách hàng", rowIndex].Value.ToString(); string ten = dgvKH["Tên khách hàng", rowIndex].Value.ToString(); DateTime ngaysinh = (DateTime)dgvKH["Ngày sinh", rowIndex].Value; string sdt = dgvKH["Số điện thoại", rowIndex].Value.ToString(); string diaChi = dgvKH["Địa chỉ", rowIndex].Value.ToString(); if (dgvKH["Action", rowIndex].Value.ToString().Trim() == "D") { khbll.KhoiPhuc(ma, ten, ngaysinh, sdt, diaChi); MessageBox.Show("Ðã khôi phục khách hàng " + ten, "THÔNG BÁO!", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (dgvKH["Action", rowIndex].Value.ToString().Trim() == "U") { khbll.KhachHang_Update(ma, ten, ngaysinh, sdt, diaChi); MessageBox.Show("Ðã khôi phục khách hàng " + ten, "THÔNG BÁO!", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }