Ejemplo n.º 1
0
        public StatistiekViewModel()
        {
            ReservationDataService dbReservation = new ReservationDataService();

            MostUsedParkPlace = dbReservation.GetMostReservedParkingPlace();
            MostUsedUser      = dbReservation.GetMostReservedUser();

            //Barchart
            CountReservationsPerDay = new SeriesCollection
            {
                new ColumnSeries
                {
                    Title  = "Reservation \n per day",
                    Values = new ChartValues <int> {
                    }
                }
            };

            CountReservationPerDayFormat = value => value.ToString("0");
            countReservationPerDayLabel  = new List <String>();

            List <Graph <string, int> > countReservationsPerDayData = dbReservation.GetCountReservationEveryDay();

            foreach (Graph <string, int> data in countReservationsPerDayData)
            {
                CountReservationsPerDay.First().Values.Add((int)data.YValue);
                countReservationPerDayLabel.Add(data.XValue);
            }
            //endBarchart

            //instantiëren DialogService als singleton
            dialogService = new DialogService();

            KoppelCommands();
        }
Ejemplo n.º 2
0
        public void TestMethodGetCountReservationEveryDay()
        {
            ReservationDataService      ds   = new ReservationDataService();
            List <Graph <string, int> > test = ds.GetCountReservationEveryDay();

            Assert.AreEqual(4, 4);
        }