Exemplo n.º 1
0
        protected internal static void SeeDoctorsTimeTable(Clinic clinic)
        {
            Console.WriteLine("\n 1. Find Doctor by ID \t 2. Select Doctor from the Doctors List");
            Console.Write(" Answer: ");
            int number = Convert.ToInt32(Console.ReadLine());

            if (number == 1)
            {
                Console.Write(" Doctor's ID: ");
                int ID = Convert.ToInt32(Console.ReadLine());
                var DoctorsTimeTable = clinic.GetDoctorsWeekSchedule(ID);
                foreach (var workday in DoctorsTimeTable)
                {
                    Console.WriteLine(" " + workday.dayOfWeek + "   \t" + workday.sTime.TimeOfDay + " - " + workday.eTime.TimeOfDay);
                }
            }
            if (number == 2)
            {
                Console.WriteLine();
                foreach (var doctor in clinic.doctors)
                {
                    Console.WriteLine(" " + doctor.ID + ". " + doctor.Name + " " + doctor.Specialty);
                }
                Console.Write(" Number: ");
                int ID = Convert.ToInt32(Console.ReadLine());
                var DoctorsTimeTable = clinic.GetDoctorsWeekSchedule(ID);
                foreach (var workday in DoctorsTimeTable)
                {
                    Console.WriteLine(" " + workday.dayOfWeek + "   \t" + workday.sTime.TimeOfDay + " - " + workday.eTime.TimeOfDay);
                }
            }
            return;
        }