public ActionResult Index() { var oisService = new OperationalIntervalService(); var oisList = oisService.GetOperationalIntervals(); return(View(oisList)); }
private void SetDropdownsInViewBags() { var operationalIntervalService = new OperationalIntervalService(); var stationService = new StationService(); var lineService = new LineService(); ViewBag.Stations = stationService.GetStations() .OrderBy(a => a.StationName) .ToList(); ViewBag.Ois = operationalIntervalService.GetOperationalIntervals() .OrderBy(a => a.Name) .Select(a => new SelectListItem { Text = a.Name, Value = a.Id.ToString() }) .ToList(); ViewBag.Lines = lineService.getLines() .OrderBy(a => a.LineName) .Select(a => new SelectListItem { Text = a.LineName, Value = a.Id.ToString() }) .ToList(); }
public ActionResult DeleteOis(int id) { var oisService = new OperationalIntervalService(); oisService.DeleteOis(id); return(RedirectToAction("Index")); }
public ActionResult UpdateOis(OperationalIntervalVm oisVm) { var oisService = new OperationalIntervalService(); oisService.UpdateOperationalInterval(oisVm); return(RedirectToAction("Index")); }
public ActionResult AddOis(OperationalIntervalVm ois) { var oisService = new OperationalIntervalService(); oisService.AddOis(ois); return(RedirectToAction("Index")); }
public ActionResult UpdateOis(int?id) { if (id == null) { return(RedirectToAction("Index")); } var oisService = new OperationalIntervalService(); var ois = oisService.GetOperationalInterval(id.Value); return(View(ois)); }