private void DeleteBusinessPartner(object obj) { if (MessageBox.Show("Are you Sure You want to Delete this Record?", "Pinna Fitness", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning) == MessageBoxResult.Yes) { try { SelectedBusinessPartner.Enabled = false; var stat = _businessPartnerService.Disable(SelectedBusinessPartner); if (stat == string.Empty) { BusinessPartners.Remove(SelectedBusinessPartner); } else { MessageBox.Show("Can't Delete, may be the data is already in use..." + Environment.NewLine + stat, "Can't Delete", MessageBoxButton.OK, MessageBoxImage.Error); } } catch (Exception ex) { MessageBox.Show("Can't Delete, may be the data is already in use..." + Environment.NewLine + ex.Message + Environment.NewLine + ex.InnerException, "Can't Delete", MessageBoxButton.OK, MessageBoxImage.Error); } } }