public void UnpackFirmen(XmlElement root) { foreach (XmlNode element in root.ChildNodes) { Models.Firma firma = new Models.Firma(); foreach (XmlNode item in element.ChildNodes) { if (item.Name == "ID") { firma.ID = item.InnerText; } if (item.Name == "Name") { firma.Name = item.InnerText; } if (item.Name == "UID") { firma.UID = item.InnerText; } if (item.Name == "Adresse") { firma.Adresse = item.InnerText; } if (item.Name == "Ort") { firma.Ort = item.InnerText; } if (item.Name == "PLZ") { firma.PLZ = item.InnerText; } if (item.Name == "RechnungsAdresse") { firma.RechnungsAdresse = item.InnerText; } if (item.Name == "RechnungsOrt") { firma.RechnungsOrt = item.InnerText; } if (item.Name == "RechnungsPLZ") { firma.RechnungsPLZ = item.InnerText; } if (item.Name == "LieferAdresse") { firma.LieferAdresse = item.InnerText; } if (item.Name == "LieferOrt") { firma.LieferOrt = item.InnerText; } if (item.Name == "LieferPLZ") { firma.LieferPLZ = item.InnerText; } } Firmen.Add(firma); } }
public void SearchList() { Firmen.Clear(); foreach (Models.Firma item in FirmenList) { if (item.Name.Contains(Suche)) { Firmen.Add(item); } } }