private void Populate() { inspRep = new InspectionRepository(); //IEnumerable<Inspection> inspections = Context.Inspections; //IEnumerable<InspectionViewModel> inspectionsVM = inspections // .Select(o => new InspectionViewModel(o)); //Inspections = new ObservableCollection<InspectionViewModel>(inspectionsVM); //RaisePropertyChanged("Inspections"); //INSPECTIES PER MAAND InspectionsPerMonth = new ObservableCollection <InspectionPerMonth>(); IEnumerable <KeyValuePair <Int32, Int32> > query = inspRep.GetInspectionsPerMonth(); string[] months = new string[12] { "Januari", "februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December" }; foreach (var t in query) { InspectionsPerMonth.Add(new InspectionPerMonth() { Maand = months[t.Key - 1], Count = t.Value }); } //END INSPECTIES PER MAAND //AANTAL INSPECTIES PER INSPECTEUR //END AANTAL INSPECTIES PER INSPECTEUR }
private void Populate() { inspRep = new InspectionRepository(); //IEnumerable<Inspection> inspections = Context.Inspections; //IEnumerable<InspectionViewModel> inspectionsVM = inspections // .Select(o => new InspectionViewModel(o)); //Inspections = new ObservableCollection<InspectionViewModel>(inspectionsVM); //RaisePropertyChanged("Inspections"); //INSPECTIES PER MAAND InspectionsPerMonth = new ObservableCollection<InspectionPerMonth>(); IEnumerable<KeyValuePair<Int32, Int32>> query = inspRep.GetInspectionsPerMonth(); string[] months = new string[12] { "Januari", "februari" , "Maart", "April" , "Mei" , "Juni" , "Juli" , "Augustus" , "September" , "Oktober" , "November", "December" }; foreach (var t in query) { InspectionsPerMonth.Add(new InspectionPerMonth() { Maand = months[t.Key - 1], Count = t.Value}); } //END INSPECTIES PER MAAND //AANTAL INSPECTIES PER INSPECTEUR //END AANTAL INSPECTIES PER INSPECTEUR }