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

            Booking = await _context.Booking
                      .Include(b => b.TheCustomer)
                      .Include(b => b.TheRoom).FirstOrDefaultAsync(m => m.ID == id);

            if (Booking == null)
            {
                return(NotFound());
            }
            ViewData["CustomerEmail"] = new SelectList(_context.Set <Customer>(), "Email", "Email");
            ViewData["RoomID"]        = new SelectList(_context.Room, "ID", "Level");
            return(Page());
        }
Example #2
0
 public IActionResult OnGet()
 {
     ViewData["CustomerEmail"] = new SelectList(_context.Set <Customer>(), "Email", "Email");
     ViewData["RoomID"]        = new SelectList(_context.Room, "ID", "Level");
     return(Page());
 }