示例#1
0
        public Rushhour generateRushhour()
        {
            Rushhour r = new Rushhour();

            r.spread = spread;
            r.start  = start;
            r.end    = end;

            return(r);
        }
示例#2
0
        public IActionResult EditLocationScenario(EditRushourViewModel viewmodel)
        {
            Scenario scenario = null;

            if (!cache.TryGetValue("ScenarioEdit", out scenario))
            {
                scenario = new Scenario();
            }

            scenario.rushhours = new List <Rushhour>();

            for (int i = 0; i < viewmodel.startTimes.Count; i++)
            {
                Rushhour r = new Rushhour()
                {
                    start = viewmodel.startTimes[i], spread = viewmodel.spreads[i]
                };
                r.end = new DateTime(r.start.Year, r.start.Month, r.start.Day, viewmodel.endTimes[i].Hour, viewmodel.endTimes[i].Minute, 0);
                scenario.rushhours.Add(r);
            }


            return(View(scenario.location));
        }
示例#3
0
 public RushhourExportImportViewModel(Rushhour rushhour)
 {
     start  = rushhour.start;
     end    = rushhour.end;
     spread = rushhour.spread;
 }