Beispiel #1
0
        public IActionResult Index()
        {
            LinesIndexViewModel model = new LinesIndexViewModel()
            {
                Lines = lineService.GetAll().Select(l => new LineIndexViewModel()
                {
                    ArrivalTime   = l.ArrivalTime.ToString("hh:mm"),
                    Date          = l.Date.ToString("MM/dd/yyyy"),
                    Departure     = l.Departure,
                    DepartureTime = l.DepartureTime.ToString("hh:mm"),
                    Destination   = l.Destination,
                    TrainNumber   = trainService.GetById(l.TrainId).Number,
                    LineId        = l.Id
                }).ToList()
            };

            return(View(model));
        }
Beispiel #2
0
        //
        // GET: /Platform/City/Details/5

        public ActionResult Details(object id)
        {
            var item = _trainService.GetById(id);

            return(View(item));
        }
Beispiel #3
0
        public IActionResult Delete(Guid id)
        {
            trainService.Delete(trainService.GetById(id));

            return(RedirectToAction("Index"));
        }