private void btnDeleteCustomer_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show(this, "Warning this action cannot be undone. Are you sure You wish to delete a customer.", "Delete Customer", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogResult == DialogResult.Yes) { CustomerDb.DeleteCustomer(CustomerId); MessageBox.Show(this, "The Customer has Been Deleted.", "Delete Customer", MessageBoxButtons.OK, MessageBoxIcon.Information); if (dialogResult == DialogResult.Yes) { BindCustomerDetail(CustomerId, DatabaseId); } } else if (dialogResult == DialogResult.No) { //do something else } }