Exemplo n.º 1
0
        static void Main(string[] args)
        {
            #region OTHER
            WorkDay work   = new WorkDay();
            WorkDay offDay = new WorkDay();
            offDay.ChangeDayToBusy();
            workDays.Add(work);
            workDays.Add(offDay);
            workDays.Add(work);
            workDays.Add(work);
            workDays.Add(work);
            #endregion

            #region DOCTORS
            Doctor d1 = new Doctor("Kuba", "Rzucidło", RandomPESEL(), SpecjalizationEnum.Cardiologist);
            Doctor d2 = new Doctor("Kasia", "Tobuk", RandomPESEL(), SpecjalizationEnum.Laryngologist);
            Doctor d3 = new Doctor("Retek", "Rydzyk", RandomPESEL(), SpecjalizationEnum.Family);

            d2.SetDoctorAvailibity(workDays);

            doctors.Add(d1);
            doctors.Add(d2);
            doctors.Add(d3);
            #endregion

            #region PATIENTS
            Adress a1 = new Adress("Kwiatowa", "Raciąż", CountryCode.PL, "09-140");

            Patient p1 = new Patient("Maciej", "Hawrzyniak", RandomPESEL(), a1);
            Patient p2 = new Patient("Marta", "Kkrawa", RandomPESEL(), a1);
            Patient p3 = new Patient("John", "Akoczny", RandomPESEL(), a1);

            patients.Add(p1);
            patients.Add(p2);
            patients.Add(p3);
            #endregion



            ClinicService clinicService = new ClinicService(patients, doctors);

            while (WorkStatus)
            {
                clinicService = RefreshClinicService();


                ShowClinicMenu();
                menuAnswer = Console.ReadLine();
                switch (menuAnswer)
                {
                case "1":
                    Console.Clear();
                    Patient patient = AddPatient();
                    patients.Add(patient);
                    break;

                case "2":
                    Console.Clear();
                    if (patients.Count > 0)
                    {
                        Console.WriteLine("Podaj PESEL pacjenta: ");
                        clinicService.RemovePatient(GetPeselFromUser());
                        patients = clinicService.GetPatients();
                    }
                    else
                    {
                        Console.WriteLine("LISTA PACJENTOW JEST PUSTA!!");
                    }

                    break;

                case "3":
                    Console.Clear();
                    Doctor doctor = AddDoctor();
                    doctors.Add(doctor);
                    break;

                case "4":
                    Console.Clear();
                    if (doctors.Count > 0)
                    {
                        Console.WriteLine("Podaj PESEL doktora: ");
                        clinicService.RemoveDoctor(GetPeselFromUser());
                        doctors = clinicService.GetDoctors();
                    }
                    else
                    {
                        Console.WriteLine("LISTA DOKTOROW JEST PUSTA!!");
                    }

                    break;

                case "5":
                    Console.Clear();
                    if (patients.Count > 0)
                    {
                        clinicService.SortPatients();
                        patients = clinicService.GetPatients();
                        Console.WriteLine("----------------");
                        Console.WriteLine("PACJENCI ZOSTALI POSORTOWANI!!!");
                        Console.WriteLine("----------------");
                    }
                    else
                    {
                        Console.WriteLine("LISTA PACJENTOW JEST PUSTA!!");
                    }
                    break;

                case "6":
                    Console.Clear();
                    clinicService.ShowPatient();
                    break;

                case "7":
                    Console.Clear();
                    Console.WriteLine("Podaj nazwisko pacjenta: ");
                    string surname = Console.ReadLine();
                    clinicService.SearchBySurname(surname);
                    break;

                case "8":
                    Console.Clear();
                    int day  = clinicService.CheackDay();
                    int hour = clinicService.CheackHour();
                    clinicService.ShowInfoAboutDoctors(day, hour);
                    break;

                case "9":
                    Console.Clear();
                    clinicService.ArrangeThePactient();
                    patients = clinicService.GetPatients();
                    doctors  = clinicService.GetDoctors();

                    break;

                case "10":
                    Console.Clear();
                    clinicService.ShowDoctors();
                    break;

                case "11":
                    Console.Clear();
                    clinicService.ShowPatientVisits();
                    break;

                case "12":

                    break;

                case "13":
                    Console.Clear();
                    WorkStatus = false;
                    break;

                default:

                    break;
                }
            }
            EndProgramInfo();
        }