Ejemplo n.º 1
0
        // GET: HISTORC
        public ActionResult Index(string date)
        {
            Models.ViewModel.HistoricModel HistModel = new Models.ViewModel.HistoricModel();

            if (date == null)
            {
                HistModel.AllHistoricEvents = historyRepository.GetAllHistoryEvents();
            }
            else
            {
                DateTime datetime = Convert.ToDateTime(date);
                HistModel.AllHistoricEvents = historyRepository.GetHistoricEvents(datetime);
            }
            return(View(HistModel));
        }
        public HistoricViewModel FillViewModel()
        {
            viewmodel.historicPerDay = GetHistoricPerDay(new DateTime(2018, 7, 26));
            viewmodel.Historics      = historicrepository.GetHistoricEvents();
            viewmodel.languages      = GetLanguages();
            viewmodel.Stops          = historicrepository.GetStops();
            viewmodel.historicsLeft  = getHistoricsLeft();
            // hiermee maak ik drie lege lijstjes aan waarna ik ze vul uit GetStarts()
            List <DayOfWeek> days;
            List <DateTime>  starttimes;
            List <DateTime>  endtimes;

            viewmodel.getStarts(viewmodel.historicsLeft, out starttimes, out endtimes, out days);
            viewmodel.times = starttimes;
            viewmodel.days  = days;

            return(viewmodel);
        }