public async Task <IActionResult> Create(Guid id)
        {
            var act = await actQueries.GetAct(id);

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

            var venues = await venueQueries.ListVenues();

            var nextWeek  = DateTime.Now.Date.AddDays(7).AddHours(19);
            var viewModel = new CreateShowViewModel
            {
                Act    = act,
                Venues = venues.Select(venue => new SelectListItem
                {
                    Value = venue.VenueGuid.ToString(),
                    Text  = $"{venue.Name}, {venue.City}"
                }).ToList(),
                StartTime = nextWeek
            };

            if (TempData["CustomError"] != null)
            {
                ModelState.AddModelError(String.Empty, TempData["CustomError"].ToString());
            }
            return(View(viewModel));
        }
        public async Task <IActionResult> OnGet()
        {
            var act = await actQueries.GetAct(ActGuid);

            if (act == null)
            {
                return(NotFound());
            }
            else
            {
                Title     = act.Title;
                ImageHash = act.ImageHash;
                return(Page());
            }
        }
Example #3
0
        public async Task OnGet()
        {
            var act = await actQueries.GetAct(ActGuid);

            if (act == null)
            {
                AddAct = true;
            }
            else
            {
                AddAct            = false;
                Title             = act.Title;
                ImageHash         = act.ImageHash;
                LastModifiedTicks = act.LastModifiedTicks;
            }
        }
Example #4
0
        public async Task Notify(Show show)
        {
            var act = await actQueries.GetAct(show.Act.ActGuid);

            var venue = await venueQueries.GetVenue(show.Venue.VenueGuid);

            var showAdded = new ShowAdded
            {
                act = new ActRepresentation
                {
                    actGuid     = act.ActGuid,
                    description = new ActDescriptionRepresentation
                    {
                        title        = act.Title,
                        imageHash    = act.ImageHash,
                        modifiedDate = new DateTime(act.LastModifiedTicks)
                    }
                },
                venue = new VenueRepresentation
                {
                    venueGuid   = venue.VenueGuid,
                    description = new VenueDescriptionRepresentation
                    {
                        name         = venue.Name,
                        city         = venue.City,
                        modifiedDate = new DateTime(venue.LastModifiedTicks)
                    },
                    location = venue.ToVenueLocationRepresentation(),
                    timeZone = new VenueTimeZoneRepresentation
                    {
                        timeZone     = venue.TimeZone,
                        modifiedDate = new DateTime(venue.TimeZoneLastModifiedTicks)
                    }
                },
                show = new ShowRepresentation
                {
                    startTime = show.StartTime
                }
            };

            await publishEndpoint.Publish(showAdded);
        }