public AppointmentView SendAppointment(AppointmentView appointment, PatientView patient)
 {
     Patient newPatient = VMC.PatientViewConverter(this, appointment, patient);
     Operations.ReceiveAppointment(newPatient);
     appointment.ID = newPatient.preferredDoctor.getAppointmentByPatient(newPatient.contactInformation.Name).ID;
     return appointment;
 }
 public AppointmentInfoWindow()
 {
     InitializeComponent();
     this.Appointment = new AppointmentView();
     this.Office = (DoctorsOfficeView)Application.Current.FindResource("Office");
     this.Patient = (PatientView)Application.Current.FindResource("Patient");
     Appointment.Patient = Patient.ContactInformation.Name;
 }
 public SelectTimeWindow()
 {
     InitializeComponent();
     this.Appointment = (AppointmentView)Application.Current.FindResource("Appointment");
     this.Office = (DoctorsOfficeView)Application.Current.FindResource("Office");
     this.Patient = (PatientView)Application.Current.FindResource("Patient");
     MainControl.DataContext = Appointment;
     AvailableTimes.ItemsSource = Appointment.AvailableTimes;
 }
        public Patient PatientViewConverter(DoctorsOfficeView Office, AppointmentView appointment, PatientView Patient)
        {
            ContactInformation contactInformation = ContactInformationViewConverter(Patient.ContactInformation);
            Insurance insurance = InsuranceViewConverter(Patient.insurance);
            Doctor doctor = Office.Operations.SearchDoctors(appointment.Doctor);
            DateTime preferredDate = appointment.Time.Date;
            TimeSpan preferredTime = appointment.Time.TimeOfDay;
            Symptom symptom = SymptomViewConverter(Patient.Symptom);

            return new Hospital.Patient(contactInformation, symptom, insurance, doctor, preferredDate, preferredTime);
        }
 private void SelectTimeButton_Click(object sender, RoutedEventArgs e)
 {
     Appointment.Time = (DateTime)AvailableTimes.SelectedItem;
     Appointment = Office.SendAppointment(Appointment, Patient);
     if (Appointment.ID > 0)
     {
         Application.Current.Resources["Appointment"] = Appointment;
         SuccessWindow successWindow = new SuccessWindow();
         successWindow.Show();
         this.Close();
     }
 }
 public SuccessWindow()
 {
     InitializeComponent();
     this.Appointment = (AppointmentView)Application.Current.FindResource("Appointment");
     MainControl.DataContext = Appointment;
 }