private void setUpData()
        {
            schuelerCollection = new ObservableCollection <Schueler>(schuelerListDerKartei);

            List <Tischgruppe> gruppen = sitzplanFuerBlock.getTischgruppen();

            foreach (Schueler schueler in schuelerCollection)
            {
                // with index
                foreach (var tischgruppe in gruppen.Select((value, i) => new { i, value }))
                {
                    var             tisch       = tischgruppe.value;
                    var             index       = tischgruppe.i;
                    Tischgruppe     tischGruppe = (Tischgruppe)tischgruppe.value;
                    List <Schueler> sitzplaetze = tischGruppe.getSitzplaetze();
                    foreach (var sitzplatz in sitzplaetze.Select((value, i) => new { i, value }))
                    {
                        if (sitzplatz.value != null && sitzplatz.value.name == schueler.name)
                        {
                            int echterSitzplatz  = sitzplatz.i + 1;
                            int echteTischnummer = tischgruppe.i + 1;
                            schueler.sitzplatznummer = echterSitzplatz.ToString();
                            schueler.tischnummer     = echteTischnummer.ToString();
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void setTischgruppe(Tischgruppe tischgruppe, int index)
 {
     this.tischgruppen[index] = tischgruppe;
 }