Exemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Appointment = await _context.Appointment
                          .Include(a => a.Category)
                          .Include(a => a.Doctor).FirstOrDefaultAsync(m => m.ID == id);

            if (Appointment == null)
            {
                return(NotFound());
            }
            ViewData["CategoryID"] = new SelectList(_context.Set <Category>(), "ID", "CategoryName");
            ViewData["DoctorID"]   = new SelectList(_context.Set <Doctor>(), "ID", "DoctorName");
            return(Page());
        }
Exemplo n.º 2
0
 public IActionResult OnGet()
 {
     ViewData["CategoryID"] = new SelectList(_context.Set <Category>(), "ID", "CategoryName");
     ViewData["DoctorID"]   = new SelectList(_context.Set <Doctor>(), "ID", "DoctorName");
     return(Page());
 }