public ActionResult SeancesByTheaterMovieAndDate(long theaterId, long movieId, string dateStr)
        {
            ViewBag.TheaterId = theaterId;
            var date                   = DateTime.ParseExact(dateStr, "dd.MM.yyyy", System.Globalization.CultureInfo.InvariantCulture);
            var seanceData             = seanceService.GetDataFromAPISeanceByMovieTheaterAndDate(theaterId, movieId, date.ToString("yyyy-MM-dd"));
            var seancesModelForTheater = mapperSeanceModelForTheater.Map <SeanceData, SeancesModelForTheater>(seanceData);
            var seances                = seancesModelForTheater.Seances;

            seancesModelForTheater.TimeSeances = GetListSeances(seances);

            if (seancesModelForTheater.Seances.Count > 0)
            {
                return(PartialView(seancesModelForTheater));
            }
            else
            {
                ViewBag.TheaterName = (theaterId == 8) ? "Флоренция" : "Boomer";
                return(PartialView("WithoutSeances"));
            }
        }
Beispiel #2
0
        public void GetAllFromAPISeanceByMovieTheaterAndDate_Test()
        {
            var florence   = 8;
            var princess   = 47974;
            var date       = DateTime.Now.ToString("yyyy-MM-dd");
            var seanceData = seanceService.GetDataFromAPISeanceByMovieTheaterAndDate(florence, 47287, date);

            Trace.WriteLine($"----theater: { seanceData.Theaters.FirstOrDefault().Name}");
            foreach (var item in seanceData.Seances)
            {
                TraceSeance(item);
                Trace.WriteLine("\n********************************************");
            }
        }
Beispiel #3
0
        public ActionResult Hall(long cinemaId, long hallId, long seanceId, string dateSeance, long timeSeanceId, long movieId)
        {
            var seanceData   = seanceService.GetDataFromAPISeanceByMovieTheaterAndDate(cinemaId, movieId, dateSeance);
            var movieModel   = mapperMovieModel.Map <Movie, MovieBookModel>(movieService.GetFromAPI(movieId));
            var theaterModel = mapperTheaterModel.Map <Theater, TheaterBookModel>(seanceData.Theaters[0]);
            var date         = DateTime.ParseExact(dateSeance, "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
            var seanceModel  = mapperSeanceModel.Map <Seance, SeanceModel>(seanceData.Seances.Find(s => s.Id == seanceId));
            var timeSeance   = seanceModel.Times.Find(t => t.Id == timeSeanceId);

            var hallName    = seanceData.Halls.Find(h => h.Id == seanceModel.HallId).Name;
            var technology  = (timeSeance.Is3D == true) ? "3D" : "2D";
            var pricesModel = mapperPriceModel.Map <List <Price>, List <PriceModel> >(PriceFormer.Prices(timeSeance.Prices));

            var bookData = new BookDataModel(timeSeanceId, hallName, date, movieModel, timeSeance, theaterModel, technology, pricesModel);

            //ViewBag.LastElId = bookService.GetLastElId();

            return(View(bookData));
        }