Пример #1
0
        public void CreateNewSingleSchedule(string Name, TimeSpan TimeOfDay, DateTime Date)
        {
            SingleSchedule scheduleToAdd = new SingleSchedule
            {
                Name = Name,
                TimeOfDay = TimeOfDay,
                Date = Date
            };

            schedules.Add(scheduleToAdd);
        }
        public void AddAppointmentToCalendar(Patient patient, Doctor doctor)
        {
            SingleSchedule newScheduleItem = new SingleSchedule
            {
                Name = String.Format("Appointment for {0} with Dr. {1}", patient.contactInformation.Name, doctor.contactInformation.Name),
                TimeOfDay = patient.preferredTime,
                Date = patient.preferredDate,
                Patient = patient.contactInformation.Name,
                Doctor = doctor.contactInformation.Name,
                ID = GetAppointmentNumber()
            };

            doctor.schedules.Add(newScheduleItem);
            doctor.GenerateCalendar();
            Appointment appointment = doctor.getAppointmentByPatient(patient.contactInformation.Name);
            doctor.UpdateCalendar(appointment);
        }