public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } DocSchedule = await _context.DocSchedules .Include(d => d.Doc) .Include(d => d.Patient).FirstOrDefaultAsync(m => m.DocScheduleID == id); if (DocSchedule == null) { return(NotFound()); } //ViewData["DocID"] = new SelectList(_context.Docs, "DocID", "Office"); //ViewData["PatientID"] = new SelectList(_context.Patients, "PatientID", "MedicalHistoryRegistoreNumber"); Doc = await _context.Docs .Include(d => d.Contact) .OrderBy(d => d.Contact.LastName) .ToListAsync(); Contact = await _context.Contacts .Include(c => c.Address) .OrderBy(c => c.LastName) .ToListAsync(); Patient = await _context.Patients .Include(p => p.Contact) .OrderBy(p => p.Contact.LastName) .ToListAsync(); return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } DocSchedule = await _context.DocSchedules .Include(d => d.Doc) .Include(d => d.Patient).FirstOrDefaultAsync(m => m.DocScheduleID == id); if (DocSchedule == null) { return(NotFound()); } Doc = await _context.Docs .Include(d => d.Contact) .OrderBy(d => d.Contact.LastName) .ToListAsync(); Patient = await _context.Patients .Include(d => d.Contact) .OrderBy(d => d.Contact.LastName) .ToListAsync(); return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } DocSchedule = await _context.DocSchedules.FindAsync(id); if (DocSchedule != null) { _context.DocSchedules.Remove(DocSchedule); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } DocSchedule = await _context.DocSchedules .Include(d => d.Doc) .Include(d => d.Patient).FirstOrDefaultAsync(m => m.DocScheduleID == id); if (DocSchedule == null) { return(NotFound()); } return(Page()); }