Ejemplo n.º 1
0
        public async Task <ActionResult> Edit(int id)
        {
            ViewBag.VenueId = id;
            var metaData = await _venueMetaDataRepository.GetVenueMetaData(id) ?? new VenueMetaData
            {
                VenueId = id, Data = new
                {
                }
            };

            return(View(metaData));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Index(int concertId)
        {
            if (concertId == 0)
            {
                return(RedirectToAction("Index", "Home"));
            }

            // Map to ViewModel
            var viewModel = _findSeatsRepository.GetFindSeatsData(concertId);

            // Add Collections
            viewModel.ExpirationMonths = GetCardExpirationMonths();
            viewModel.ExpirationYears  = GetCardExpirationYears();

            // Get DocumentDB MetaData
            VenueMetaData metaData = null;

            if (!WingtipTicketApp.Config.RunningInDev)
            {
                metaData = await _venueMetaDataRepository.GetVenueMetaData(viewModel.Concert.VenueId);
            }

            viewModel.VenueMetaData =
                metaData != null ?
                new FindSeatsViewModel.VenueMetaDataViewModel()
            {
                VenueId = metaData.VenueId,
                Data    = metaData.Data,
            } : null;

            // Get SeatMap
            if (!WingtipTicketApp.Config.RunningInDev)
            {
                var seatMap = PowerBiHelper.FetchReport(ConfigHelper.SeatMapReportId);
                viewModel.SeatMap     = seatMap.Report;
                viewModel.AccessToken = seatMap.AccessToken;
            }

            return(View(viewModel));
        }