public IActionResult NewAppointment(AppointmentRequestViewModel model) { if (ModelState.IsValid) { if (model.PhoneNumber.Length == 10) { ModelState.Clear(); ViewBag.AppointmentSuccess = "Your information has been successfully sent! We will be in touch with you shortly"; } else { ViewBag.ValidationError = "Phone number is not valid, format: 1234567890"; } } else { ViewBag.AppointmentSuccess = ""; } return(View()); }
public ActionResult RequestAppointment(AppointmentRequestViewModel appointmentRequest, int patientId) { _schedulingService.RequestAppointment(patientId, null, appointmentRequest.Reason); // Redirect to Appointments return(RedirectToAction("RequestMessage", "Patient")); }