public Rushhour generateRushhour() { Rushhour r = new Rushhour(); r.spread = spread; r.start = start; r.end = end; return(r); }
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)); }
public RushhourExportImportViewModel(Rushhour rushhour) { start = rushhour.start; end = rushhour.end; spread = rushhour.spread; }