public void BookAppointment() { if (Timeslot == null) { Alert("No Avaliability.", "No appointments are avaliable today. Please book a reservation appointment to be seen on another day."); return; } int doctorID = int.Parse(Timeslot[0].ToString()); string timeslot = Timeslot[1].ToString(); if (PatientDBConverter.PatientHasAppointment(patientID)) { Alert("Appointment not booked", "You already have an appointment booked today. Please check your emails for notificaitons or speak to the receptionist."); MessengerInstance.Unregister(this); MessengerInstance.Send <string>("DecideHomeView"); return; } PatientDBConverter.BookAppointment(timeslot, doctorID, patientID, false); AppointmentLogic.ScheduleWalkInNotification(TimeSpan.Parse(timeslot), patientID); var dialog = new SuccessBoxViewModel("Appointment Booked.", //MOVE THIS "Appointment has been successfully booked. Please keep an eye on your emails for updates on when we can see you."); var result = _dialogService.OpenDialog(dialog); MessengerInstance.Unregister(this); MessengerInstance.Send <string>("DecideHomeView"); }
// Interacts with Data Layer Model to book appointment public void BookAppointment() { if (TimeslotIndex.Equals(-1)) { Alert("No timeslot selected.", "Please select a timeslot for your appointment"); return; } if (PatientDBConverter.PatientHasAppointment(patientID, SelectedDate.ToShortDateString())) { Alert("Appointment Not Booked.", "You already have a GP appointment for this day. Please speak to the receptionist for details on your appointment or select another day."); return; } string selectedTimeslot = AvaliableTimes.Rows[(int)TimeslotIndex][1].ToString(); int reservationDoctorID = int.Parse(AvaliableTimes.Rows[(int)TimeslotIndex][0].ToString()); if (string.IsNullOrWhiteSpace(Comment)) { Comment = ""; } PatientDBConverter.BookAppointment(selectedTimeslot, reservationDoctorID, patientID, true, Comment, SelectedDate.ToShortDateString()); // Sends email Success EmailConfirmation.ReservationConfirmationEmail(patientID, SelectedDate, selectedTimeslot); var dialog = new SuccessBoxViewModel("Appointment Booked.", //MOVE THIS "Appointment has been successfully booked. Please keep an eye on your emails for updates on when we can see you."); var result = _dialogService.OpenDialog(dialog); MessengerInstance.Unregister(this); MessengerInstance.Send <string>("DecideHomeView"); }
private void Success(string title, string message) { var dialog = new SuccessBoxViewModel(title, message); var result = _dialogService.OpenDialog(dialog); }