private void btnXoa_Click(object sender, EventArgs e) { string idTacGia = txtIDTacGia.Text; string tenTacGia = txtTenTacGia.Text; if (idTacGia != "" && tenTacGia != "") { if (MessageBox.Show(this, $"Bạn có muốn xóa tác giả { tenTacGia } không ?", "Xác nhận", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) { try { TacGiaBUS.DeletaTacGia(idTacGia); MessageBox.Show(this, "Xóa tác giả thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadTacGia(); } catch { MessageBox.Show(this, "Không thể xóa tác giả", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } return; } MessageBox.Show(this, "ID tác giả không được để trống", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); }