public IActionResult OnGet(int id) { Appointment = appointmentData.GetAppointmentById(id); if (Appointment == null) { return(RedirectToPage("~/NotFound")); } return(Page()); }
public IActionResult GetAppointmentId(int id) { var data = appointmentData.GetAppointmentById(id); if (data == null) { return(NotFound()); } return(Ok(data)); }
public IActionResult OnGet(int?id) { if (id.HasValue) { Appointment = appointmentData.GetAppointmentById(id.Value); if (Appointment == null) { return(RedirectToPage("./NotFound")); } } else { Appointment = new Core.Appointment(); } var patients = patientData.GetPatients().ToList().Select(p => new { Id = p.Id, Display = $"{p.FirstName} {p.LastName}" }); Patients = new SelectList(patients, "Id", "Display"); Symptom = htmlHelper.GetEnumSelectList <Symptom>(); return(Page()); }
//Get Method public AppointmentTBL GetAppointmentById(int appointmentId) { var appointment1 = _appointmentData.GetAppointmentById(appointmentId); return(appointment1); }