public void SaveSearch() { if (criteria.Count > 0 && !string.IsNullOrEmpty(CriteriaDescriptionKey)) { foreach (var criterion in criteria) { if (!searchManager.SaveSearchToDatabase(configManager.CurrentUser, CriteriaDescriptionKey, PrivacyOfCriteria == PrivacyEnum.PRIVATE, TypeOfCriteria == CriteriaTypeEnum.FILTER, criterion.Key, criterion.Value)) { MessageBox.Show("Failed to save search " + CriteriaDescriptionKey, "Search Management Error", MessageBoxButton.OK, MessageBoxImage.Error); break; } } } }