Exemplo n.º 1
0
 public void AddDoctor(string name, string surname)
 {
     if (!ContainsDoctor(name))
     {
         var doctor = new Doctor(name, surname);
         DoctorsList.Add(doctor);
     }
 }
        public void AssignDoctor()
        {
            DoctorsList.Add(new ComboBoxPairs(DoctorComboBox.Key, DoctorComboBox.Value));
            foreach (Doctor doctor in Hospital.Employees.Values)
            {
                if (doctor.ID == DoctorComboBox.Key)
                {
                    Hospital.Patients[PatientID].Doctors.Add(doctor.ID, doctor);
                    HospitalDB.InsertDoctorPatient(doctor.ID, PatientID);
                    DoctorsNumber = "Doctors: " + Hospital.Patients[PatientID].Doctors.Count().ToString();
                    break;
                }
            }
            ((Doctor)Hospital.Employees[DoctorComboBox.Key]).Patients.Add(PatientID, Hospital.Patients[PatientID]);
            DoctorsComboBox.Remove(DoctorComboBox);

            Home.ViewModel.CloseRootDialog();
        }