public void RefreshDataGrid() { AllGadgets = service.GetAllGadgets(); GadgetList.Clear(); if (AllGadgets != null) { AllGadgets.ForEach(GadgetList.Add); AllLoans = service.GetAllLoans(); LoanList.Clear(); AllLoans.ForEach(LoanList.Add); } else { MessageBox.Show("Keine Verbindung zum Server gefunden!", "Fehler", MessageBoxButton.OK, MessageBoxImage.Error); Application.Current.Shutdown(); } }
public void filterGadgets(String filter) { GadgetList.Clear(); if (filter.Length > 0) { filter = filter.ToUpper(); AllGadgets.Where(gadget => { return(gadget.Name.ToUpper().Contains(filter) || gadget.Manufacturer.ToUpper().Contains(filter) || gadget.Price.ToString().ToUpper().Contains(filter) || gadget.InventoryNumber.ToUpper().Contains(filter) || gadget.Condition.ToString().ToUpper().Contains(filter)); }).ToList().ForEach(GadgetList.Add); } else { AllGadgets.ForEach(GadgetList.Add); } }