示例#1
0
        public ActionResult Index()
        {
            var oisService = new OperationalIntervalService();
            var oisList    = oisService.GetOperationalIntervals();

            return(View(oisList));
        }
示例#2
0
        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();
        }
示例#3
0
        public ActionResult DeleteOis(int id)
        {
            var oisService = new OperationalIntervalService();

            oisService.DeleteOis(id);

            return(RedirectToAction("Index"));
        }
示例#4
0
        public ActionResult UpdateOis(OperationalIntervalVm oisVm)
        {
            var oisService = new OperationalIntervalService();

            oisService.UpdateOperationalInterval(oisVm);

            return(RedirectToAction("Index"));
        }
示例#5
0
        public ActionResult AddOis(OperationalIntervalVm ois)
        {
            var oisService = new OperationalIntervalService();

            oisService.AddOis(ois);

            return(RedirectToAction("Index"));
        }
示例#6
0
        public ActionResult UpdateOis(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Index"));
            }
            var oisService = new OperationalIntervalService();
            var ois        = oisService.GetOperationalInterval(id.Value);

            return(View(ois));
        }