private Groep CreateGroep(Tuple <EdexVestiging, EdexGroep> groepMetVestiging) { EdexGroep edexGroep = groepMetVestiging.Item2; Groep groep = new Groep(); groep.Key = edexGroep.Key; groep.Naam = edexGroep.Naam; if (groepMetVestiging.Item1 != null) { foreach (var leerling in this.EdexAdministratie.Leerlingen.Values.Where(l => l.Groep == edexGroep.Key && l.Vestiging == groepMetVestiging.Item1.Key)) { groep.Leerlingen.Add(leerling); } } else { foreach (var leerling in EdexAdministratie.Leerlingen.Values.Where(l => l.Groep == edexGroep.Key && l.Vestiging == null)) { groep.Leerlingen.Add(leerling); } } foreach (var leerkracht in EdexAdministratie.Leerkrachten.Values.Where(l => l.Groepen.Contains(edexGroep.Key))) { groep.Leerkrachten.Add(leerkracht); } return(groep); }
internal static EdexGroep ParseerGroepBasis(XElement groepElement) { var groep = new EdexGroep(); groep.Key = groepElement.Attribute("key").Value; groep.Naam = GetElementValue(groepElement, "naam"); groep.Jaargroep = GetElementValue(groepElement, "jaargroep"); return(groep); }