private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Bạn có muốn xóa danh mục ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { categoryBLL.DeleteCategory(Int32.Parse(dgvCategory.Rows[d].Cells[0].Value.ToString())); hienthi(); } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Bạn có muốn xóa danh mục ?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { categoryBLL.DeleteCategory(Int32.Parse(dgvCategory.Rows[d].Cells[0].Value.ToString())); hienthi(); } catch (Exception x) { MessageBox.Show("Phải chọn một dòng dữ liệu", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }