Beispiel #1
0
        public async Task <IActionResult> Index()
        {
            if (TempData["Success"] as bool? ?? false)
            {
                ViewBag.Success = TempData["Success"];
                ViewBag.Message = TempData["Message"];
            }
            var model = await _appSession.ListAsync();

            return(View(model));
        }
Beispiel #2
0
        public async Task <IActionResult> Index(SessionListModel model)
        {
            await LoadData();

            if (TempData["Success"] as bool? ?? false)
            {
                ViewBag.Success = TempData["Success"];
                ViewBag.Message = TempData["Message"];
            }
            var sessions = await _appSession.ListAsync(model.MovieName, model.Date);

            model.Sessions = sessions.ToList();
            foreach (var item in model.Sessions)
            {
                var seats = await _appSession.ListAvaliableSeats(item.Id);

                item.AvaliableSeatCount = seats.Count();
            }
            return(View(model));
        }