public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var myCinema = await _cinemaService.GetCinemaById(id ?? 1);

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

            return(View(myCinema));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Возвращает представление с информацией по конкретному кинотеатру по его Id
        /// </summary>
        /// <param name="cinemaId">Id кинотеатра</param>
        public IActionResult Cinema(int cinemaId)
        {
            var aaa    = _cinemaService.GetHallsByCinemaId(cinemaId);
            var cinema = new CinemaViewDto
            {
                Cinema   = _cinemaService.GetCinemaById(cinemaId),
                FilmList = _cinemaService.GetFilmsByCinemaId(cinemaId),
                HallList = _cinemaService.GetHallsByCinemaId(cinemaId)
            };

            return(View(cinema));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var tblCinema = await _cinemaService.GetCinemaById(id ?? 1);

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

            ViewData["AdminUserId"] = new SelectList(_context.AspNetUsers, "Id", "UserName", tblCinema.AdminUserId);
            ViewData["CountryId"]   = new SelectList(_context.TblCountries, "CountryId", "CountryName", tblCinema.Adress.CountryId);
            ViewData["CityId"]      = new SelectList(_context.TblCities, "CityId", "CityName", tblCinema.Adress.CityId);

            tblCinema.AdressId   = tblCinema.Adress.AdressId;
            tblCinema.StreetName = tblCinema.Adress.StreetName;

            return(View(tblCinema));
        }
 public ServiceResponse <CinemaDto> GetCinemaById(int cinemaId) => _cinemaService.GetCinemaById(cinemaId);