private void FindPatient(object sender, RoutedEventArgs e) { PatientRegistry patientRegistry = new PatientRegistry(); if (string.IsNullOrEmpty(txtName.Text.Trim()) || string.IsNullOrEmpty(txtSurname.Text.Trim())) { MessageBox.Show("Enter data"); return; } PatientsPage.instance.lstPatients.Items.Clear(); PatientsPage.instance.lstPatients.ItemsSource = patientRegistry.Find(txtName.Text.Trim(), txtSurname.Text.Trim()); this.Close(); }
public static ScheduleDTO CreateEnroll(int doctorId, int patientId, DateTime date, string time) { PatientRegistry registry = new PatientRegistry(); PatientDTO patient = registry.Find(patientId); ScheduleDTO enroll = new ScheduleDTO { PatientId = patientId, DoctorId = doctorId, Date = date, Time = time, Addition = "Patient: " + patient.ToString() }; return(enroll); }