private void Vistis_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (Visits.SelectedItem != null) { lastSelectedAppointmentVisits = (ClassAppointment)Visits.SelectedItem; lastSelectedIndexVisits = Visits.SelectedIndex; HistoryofPacient.ItemsSource = null; HistoryofPacient.ItemsSource = ClassSqlAppointment.GetAllApoitmentsForPatien((ClassAppointment)Visits.SelectedItem); } }
public SqlAppointment() { ClassAppointment cA1 = new ClassAppointment(); cA1.AppointmendtId = 1; cA1.Description = "badania1"; cA1.Doctor = new ClassDoctor(); cA1.Doctor.Doctor_id = 1; cA1.Topic = "badania1"; cA1.Term = new ClassTerm(); cA1.Term.Date = new DateTime(1); cA1.Patient = new ClassPatient(); cA1.Patient.PatientId = 1; cA1.Patient.Name = "Waldek"; cA1.Patient.Surname = "wotal"; listAppointment.Add(cA1); ClassAppointment cA2 = new ClassAppointment(); cA2.AppointmendtId = 2; cA2.Description = "badania2"; cA2.Doctor = new ClassDoctor(); cA2.Doctor.Doctor_id = 2; cA2.Topic = "badania2"; cA2.Term = new ClassTerm(); cA2.Term.Date = new DateTime(1); cA2.Patient = new ClassPatient(); cA2.Patient.PatientId = 2; cA2.Patient.Name = "Wojtek"; cA2.Patient.Surname = "kona"; listAppointment.Add(cA2); ClassTerm t1 = new ClassTerm(); t1.TermId = 1; t1.StartTime = new TimeSpan(7, 0, 0); t1.EndTime = new TimeSpan(19, 0, 0); t1.Date = new DateTime(2021, 6, 12); listTerm.Add(t1); ClassTerm t2 = new ClassTerm(); t2.TermId = 2; t2.StartTime = new TimeSpan(7, 0, 0); t2.EndTime = new TimeSpan(19, 0, 0); t2.Date = new DateTime(2021, 7, 12); listTerm.Add(t2); }
private void ShowDetails_Click(object sender, RoutedEventArgs e) { if (HistoryOfVisits.SelectedItem != null) { ClassAppointment appointment = (ClassAppointment)HistoryOfVisits.SelectedItem; WindowDoctorHistoryOfVisitsDetails windowDoctorHistoryOfVisitsDetails = new WindowDoctorHistoryOfVisitsDetails(appointment.Patient.Name, appointment.Patient.Surname, appointment.Patient.PersonalIdentityNumber, appointment.Patient.PhoneNumber, appointment.Topic, appointment.Description); windowDoctorHistoryOfVisitsDetails.Show(); } else { MessageBox.Show("You must choose an appointment"); } }
private void HistoryofPacient_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (HistoryofPacient.SelectedItem != null && Visits.SelectedItem != null) { ClassAppointment historyAppointment = (ClassAppointment)HistoryofPacient.SelectedItem; ClassAppointment appointment = (ClassAppointment)Visits.SelectedItem; NamePatient.Text = appointment.Patient.Name; SurnamePatient.Text = appointment.Patient.Surname; PESELpatient.Text = appointment.Patient.PersonalIdentityNumber; TopicResult.Text = historyAppointment.Topic; ResultOfVisit.Text = historyAppointment.Description; lastSelectedAppointmentHistoryVistis = (ClassAppointment)HistoryofPacient.SelectedItem; lastSelectedIndexHistoryVistis = HistoryofPacient.SelectedIndex; } }