private void SearchPeopleExecute(object parameter) { String firstNameSearch = ToBeSearchedPerson.FirstName == null ? "" : ToBeSearchedPerson.FirstName; String lastNameSearch = ToBeSearchedPerson.LastName == null ? "" : ToBeSearchedPerson.LastName; String jmbgNameSearch = ToBeSearchedPerson.JMBG == null ? "" : ToBeSearchedPerson.JMBG; ListOfPeople.Clear(); PersonProxy.GetAllPeople().ForEach(p => ListOfPeople.Add(p)); if (firstNameSearch.Equals("") && lastNameSearch.Equals("") && jmbgNameSearch.Equals("")) { return; } foreach (Person p in ListOfPeople.ToList()) { if (!p.FirstName.Contains(firstNameSearch)) { ListOfPeople.Remove(p); } if (!p.LastName.Contains(lastNameSearch)) { ListOfPeople.Remove(p); } if (!p.JMBG.Contains(jmbgNameSearch)) { ListOfPeople.Remove(p); } } logger.Info("Search results"); LoggerHelper.Instance.LogMessage($"Search results.", EEventPriority.INFO, EStringBuilder.CLIENT); }
public void SaveAllData() { ListOfPeople.Add(this.person); }