public async Task <IActionResult> Selector([FromRoute] long playListId)
        {
            var PlayListList = await playListRepository.FindAllAsync();

            var PlayList      = PlayListList.FirstOrDefault(p => p.Id == playListId);
            var ReservedSeats = await seatRepository.FindAllByTimeSlotIdAsync(PlayList.TimeSlotId);

            SeatViewModel SeatViewModel = new SeatViewModel();

            SeatViewModel.Movie      = PlayList.Movie;
            SeatViewModel.TimeSlot   = PlayList.TimeSlot;
            SeatViewModel.PlayListId = playListId;

            var Seats   = ReservedSeats.ToList();
            var Seating = JSONSeatingHelper.JSONSeating(PlayList.TimeSlot.Room, Seats);

            SeatViewModel.SeatingArrangement = JSONSeatingHelper.JSONSeating(PlayList.TimeSlot.Room, Seats);

            return(View(SeatViewModel));
        }
        public async Task <IActionResult> Index(long?id)
        {
            ClaimsPrincipal currentUser = this.User;

            if (id == null)
            {
                return(NotFound());
            }

            var PlayListList = await playlistRepository.FindAllAsync();

            var PlayList = PlayListList.FirstOrDefault(p => p.Id == id);

            if (PlayList == null)
            {
                return(NotFound());
            }

            PaymentViewModel paymentViewModel = new PaymentViewModel();

            paymentViewModel.PlayList = PlayList;
            return(View(paymentViewModel));
        }
        /// <summary>
        /// Read detailed view for specific Movie based on MovieId or if an incorect movieId is provided; return NotFound
        /// </summary>
        /// <param name="id">MovieId used to read specific Movie</param>
        /// <returns>NotFound view or specific details view</returns>
        public async Task <IActionResult> Details(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var PlayListList = await repository.FindAllAsync();

            var PlayList = PlayListList.FirstOrDefault(p => p.Id == id);

            if (PlayList == null)
            {
                return(NotFound());
            }

            return(View(PlayList));
        }
Пример #4
0
        public async Task <IActionResult> IndexAsync([FromRoute] long?movieId)
        {
            if (movieId == null)
            {
                return(NotFound());
            }
            var PlayListList = await repository.FindAllAsync();

            var PlayList = PlayListList.FirstOrDefault(p => p.Id == movieId);

            if (PlayList == null)
            {
                return(NotFound());
            }

            return(View(PlayList));
        }
 /// <summary>
 /// Get the view Overview in a task for correct threading in the background
 /// </summary>
 /// <returns>Movie view with all movies from the repository</returns>
 public async Task <IActionResult> Overview()
 {
     return(View(await repository.FindAllAsync()));
 }