Пример #1
0
        public IActionResult OnGet(bool?saveChangesError = false)
        {
            ViewData["ArtistID"] = new SelectList(_context.Set <Artist>(), "ID", "StageName");
            //ViewData["EventID"] = new SelectList(_context.Set<Event>(), "ID", "EventName");
            ViewData["EventID"] = new SelectList(_context.Set <Event>(), "ID", "FullEvent");

            if (saveChangesError.GetValueOrDefault())
            {
                ErrorMessage = "Couldn't add booking. Possible duplicate entry. Try again!";
            }
            return(Page());
        }
Пример #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            ViewData["ArtistID"] = new SelectList(_context.Set <Artist>(), "ID", "StageName");
            ViewData["EventID"]  = new SelectList(_context.Set <Event>(), "ID", "EventName");
            if (id == null)
            {
                return(NotFound());
            }

            Booking = await _context.Bookings
                      .Include(b => b.Artist)
                      .Include(b => b.Event)
                      .FirstOrDefaultAsync(m => m.ID == id);

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

            return(Page());
        }
Пример #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            ViewData["ArtistID"] = new SelectList(_context.Set <Artist>(), "ID", "StageName");
            if (id == null)
            {
                return(NotFound());
            }

            Track = await _context.Tracks
                    .Include(t => t.Artist)
                    .FirstOrDefaultAsync(m => m.ID == id);

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

            return(Page());
        }
Пример #4
0
 public IActionResult OnGet()
 {
     ViewData["ArtistID"] = new SelectList(_context.Set <Artist>(), "ID", "StageName");
     return(Page());
 }