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();
 }
Beispiel #2
0
 private void selectButton_Click(object sender, RoutedEventArgs e)
 {
     patient = new Patient("first", "last", "sex", "address", 123, 5555555, "cntry", "prvnce", "cty", 11, 22, 1999, 12345, "blab,bla,lba");
     caller.ShowPatient(patient);
     this.Close();
 }