public searchPatient(editPatient input)
 {
     this.caller  = new editPatient();
     this.caller  = input;
     this.mainCal = ((editPatient)this.caller).caller;
     InitializeComponent();
     displayPatients();
 }
 private void selectButton_Click_1(object sender, RoutedEventArgs e)
 {
     if (caller != null)
     {
         if (caller.GetType() == typeof(editPatient))
         {
             editPatient temp = new editPatient();
             temp = (editPatient)caller;
             if (searchPatLB.SelectedItem != null)
             {
                 patient = (Patient)searchPatLB.SelectedItem;
                 temp.selectedPatient = patient;
                 temp.ShowPatient(patient);
             }
             temp.patientSelected = true;
         }
         else if (caller.GetType() == typeof(mainCalendarDisplayWindow))
         {
             mainCalendarDisplayWindow temp = new mainCalendarDisplayWindow();
             temp = (mainCalendarDisplayWindow)caller;
             if (searchPatLB.SelectedItem != null)
             {
                 temp.selectedPatient = (Patient)searchPatLB.SelectedItem;
             }
             if (temp.selectedPatient != null)
             {
                 temp.bookNewName.Text = "<" + temp.selectedPatient.lastName + "," + temp.selectedPatient.firstName + ">";
                 if (temp.bookNewName.Text != "<patient name>")
                 {
                     temp.bookAddButton.IsEnabled = true;
                 }
             }
         }
         else if (caller.GetType() == typeof(pastAppointments))
         {
             pastAppointments temp = new pastAppointments();
             temp = (pastAppointments)caller;
             if (searchPatLB.SelectedItem != null)
             {
                 patient = (Patient)searchPatLB.SelectedItem;
                 temp.selectedPatient = patient;
                 temp.ShowPatient(patient);
                 temp.pastPatientName.Text = patient.firstName + " " + patient.lastName;
             }
             temp.patientSelected = true;
         }
     }
     else
     {
         var mb = MessageBox.Show("caller.gettype is null");
     }
     this.Close();
 }
Ejemplo n.º 3
0
 public searchPatient(editPatient caller)
 {
     this.caller = caller;
     InitializeComponent();
 }