private List<SchoolClass> SummarizeSubstitutionForClasses(List<Substitution> substitutionList)
 {
     List<SchoolClass> classes = new List<SchoolClass>();
     bool continueWithNext;
     foreach(Substitution sub in substitutionList)
     {
         continueWithNext = false;
         foreach(SchoolClass schoolClass in classes)
         {
             if(schoolClass.ClassName == sub.Class)
             {
                 schoolClass.SubstitutionOfClass.Add(sub);
                 schoolClass.LessonsWithSubstitution += ", " + sub.Lesson;
                 continueWithNext = true;
                 break;
             }
         }
         if(continueWithNext)
         {
             continue;
         }
         SchoolClass newClass = new SchoolClass(sub.Class);
         newClass.SubstitutionOfClass = new ObservableCollection<Substitution>();
         newClass.SubstitutionOfClass.Add(sub);
         newClass.LessonsWithSubstitution = "Vertretungsstunden: " + sub.Lesson;
         classes.Add(newClass);
     }
     return classes;
 }
 private SchoolClass LoadAdditionalInfo (HtmlNode rootNode)
 {
     SchoolClass additionalInfos = new SchoolClass("Zusätzliche Informationen");
     additionalInfos.LessonsWithSubstitution = "";
     HtmlNodeCollection fussCollection = NavigateToFussNode(rootNode);
     foreach (HtmlNode additionalInfoNode in fussCollection)
     {
         Substitution information = new Substitution();
         information.Information = additionalInfoNode.ChildNodes[1].InnerText;
         additionalInfos.SubstitutionOfClass = new ObservableCollection<Substitution>();
         additionalInfos.SubstitutionOfClass.Add(information);
     }
     return additionalInfos;
 }
 private int SearchForSchoolClass(List<SchoolClass> list, SchoolClass schoolClass)
 {
     foreach(SchoolClass classInList in list)
     {
         if(classInList.ClassName == schoolClass.ClassName)
         {
             return list.IndexOf(classInList);
         }
     }
     return -1;
 }
 private List<SchoolClass> MarkClassesWithSubstitution(List<Substitution> substitutionList)
 {
     List<SchoolClass> classes = new List<SchoolClass>();
     foreach(Substitution sub in substitutionList)
     {
         SchoolClass thisClass = new SchoolClass(sub.Class);
         if(!classes.Contains(thisClass))
         {
             classes.Add(thisClass);
         }
         int index = SearchForSchoolClass(classes , thisClass);
         //classes[index].LessonsWithSubstitution.Add(sub.Lesson);
     }
     return classes;
 }
Ejemplo n.º 5
0
 public bool Equals(SchoolClass compare)
 {
     return this.ClassName == compare.ClassName;
 }
Ejemplo n.º 6
0
        private void UpdateDetailView(SchoolClass selectedClass)
        {
            //Das geht besser
            if (selectedClass.ClassName == "Zusätzliche Informationen")
            {
                detailView.ItemTemplate = this.Resources["AdditionalInfoTemplate"] as DataTemplate;
            }
            if(detailView.ItemTemplate == this.Resources["AdditionalInfoTemplate"] as DataTemplate &&
                !(selectedClass.ClassName == "Zusätzliche Informationen"))
            {
                detailView.ItemTemplate = this.Resources["DetailContentTemplate"] as DataTemplate;
            }

            detailView.ItemsSource = selectedClass.SubstitutionOfClass;
            detailView.Header = "Klasse " + selectedClass.ClassName;
            //detailView.Footer = "Letzte Aktualisierung: " + DateTime.Now.Hour + ":";
            //detailView.Footer += DateTime.Now.Minute < 10 ? "0" + DateTime.Now.Minute : DateTime.Now.Minute.ToString();
            //detailView.Footer += " Uhr";
        }
Ejemplo n.º 7
0
 private void masterListView_ItemClick(object sender , ItemClickEventArgs e)
 {
     if (AdaptiveStates.CurrentState == NarrowState)
     {
         SetColumnWidthOfDetailView();
     }
     SchoolClass selectedClass = (SchoolClass) e.ClickedItem;
     lastSelectedClass = selectedClass;
     UpdateDetailView(selectedClass);
 }