Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            Doctor          doctor       = new Doctor();
            Nurse           nurse        = new Nurse();
            Receptionist    receptionist = new Receptionist();
            Janitor         janitor      = new Janitor();
            Patient         patient      = new Patient();
            List <Employee> Employees    = new List <Employee>()
            {
                doctor,
                nurse,
                receptionist,
                janitor
            };

            PerformActivitiesMenu(Employees, patient);
        }
Exemplo n.º 2
0
        public void TickMethod()
        {
            Nurse selNurse = new Nurse();

            selNurse = (Nurse)employeeList.Find(x => x.EmployeeId == 2);
            selNurse.NumberOfPatients++;
            Console.WriteLine($"Nurse now has { selNurse.NumberOfPatients} Patients");

            //Toggle Receptionist on the phone
            Receptionist selRecpt = new Receptionist();

            selRecpt = (Receptionist)employeeList.Find(x => x.EmployeeId == 3);
            if (selRecpt.IsOnThePhone)
            {
                Console.WriteLine($"Receptionist is on the phone {selRecpt.IsOnThePhone}");
                selRecpt.IsOnThePhone = false;
            }
            else
            {
                Console.WriteLine($"Receptionist is on the phone {selRecpt.IsOnThePhone}");
                selRecpt.IsOnThePhone = true;
            }

            //Toggle Janitor is sweeping
            Janitor selJanitor = new Janitor();

            selJanitor = (Janitor)employeeList.Find(x => x.EmployeeId == 4);
            if (selJanitor.IsSweeping)
            {
                Console.WriteLine($"Janitor is sweeping {selJanitor.IsSweeping}");
                selJanitor.IsSweeping = false;
            }
            else
            {
                Console.WriteLine($"Janitor is on the phone {selJanitor.IsSweeping}");
                selJanitor.IsSweeping = true;
            }
        }
        static void Main(string[] args)
        {
            //create employee objects:
            Employee     employee     = new Employee();
            Doctor       doctor       = new Doctor("Dr. Sally", 1001, "General Surgeon");
            Nurse        nurse        = new Nurse("Jack", 1002, 1);
            Janitor      janitor      = new Janitor("Fran", 1003, true);
            Receptionist receptionist = new Receptionist("Jimmy", 1004, false);

            Patient patient = new Patient("Bob Builder");

            //Populate all emplyee Lists
            employee.employeesList.Add(doctor);
            employee.employeesList.Add(nurse);
            employee.employeesList.Add(janitor);
            employee.employeesList.Add(receptionist);


            //create menu
            string menuChoice        = "";
            string medicalMenuChoice = "";
            bool   userActive        = true;

            while (userActive)
            {
                Console.WriteLine("HOSPITAL MENU");
                Console.WriteLine("1. View Employees");
                Console.WriteLine("2. Pay All Employees");
                Console.WriteLine("3. View Patient Status");
                Console.WriteLine("4. Care For Patients");
                Console.WriteLine("5. Draw Blood");
                Console.WriteLine("6. Exit");
                menuChoice = Console.ReadLine();
                Console.Clear();

                switch (menuChoice)
                {
                case "1":
                    Console.WriteLine("EMPLOYEE LIST");
                    employee.ViewAllEmployees();
                    break;

                case "2":
                    Console.WriteLine("ACCOUNTS PAYABLE\n");
                    employee.PayAllEmployees();
                    break;

                case "3":
                    Console.WriteLine("VIEW PATIENT STATUS\n");
                    patient.ViewPatientStatus();
                    break;

                case "4":
                    Console.WriteLine("CARE FOR PATIENT\n");
                    Console.WriteLine("Please Select a Medical Employee:");
                    Console.WriteLine($"1. {doctor.Name} ");
                    Console.WriteLine($"2. Nurse {nurse.Name}");
                    medicalMenuChoice = Console.ReadLine();

                    if (medicalMenuChoice == "1")
                    {
                        doctor.CareForPatients(patient);
                    }

                    else if (medicalMenuChoice == "2")
                    {
                        nurse.CareForPatients(patient);
                    }
                    else
                    {
                        break;
                    }
                    break;

                case "5":
                    Console.WriteLine("DRAW BLOOD\n");
                    Console.WriteLine("Please Select a Medical Employee:");
                    Console.WriteLine($"1. {doctor.Name} ");
                    Console.WriteLine($"2. Nurse {nurse.Name}");
                    medicalMenuChoice = Console.ReadLine();

                    if (medicalMenuChoice == "1")
                    {
                        doctor.DrawBlood(patient);
                    }

                    else if (medicalMenuChoice == "2")
                    {
                        nurse.DrawBlood(patient);
                    }
                    else
                    {
                        break;
                    }
                    break;

                case "6":
                    userActive = false;
                    break;

                default:
                    break;
                }
                Console.ReadLine();
            }
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Hospital     myHospital   = new Hospital();
            Menu         myMenu       = new Menu();
            Janitor      janitor      = new Janitor(1, "janitor", false, false);
            Receptionist receptionist = new Receptionist(3, "receptionist", false, false);

            while (true)
            {
                Console.WriteLine("====================================MENU====================================\n\n");
                Console.WriteLine("\t\t\tUniversity Hospitals \n\t\tPatient and Employee Management System.");
                Console.WriteLine();
                Console.WriteLine("\n\t\t   SELECT FROM THE OPTIONS BELOW:\n");
                Console.WriteLine("\t\t   Press 1 to view all employee list");
                Console.WriteLine("\t\t   Press 2 for employee work status");
                Console.WriteLine("\t\t   Press 3 to pay employees");
                Console.WriteLine("\t\t   Press 4 to pay a single employee");
                Console.WriteLine("\t\t   Press 5 to view all patients");
                Console.WriteLine("\t\t   Press 6 for blood draw.");
                Console.WriteLine("\t\t   Press 7 for patient care");
                Console.WriteLine("\t\t   Press 8 to have the Receptionist answer the phone.");
                Console.WriteLine("\t\t   Press 9 to have the Janitor sweep.");
                Console.WriteLine("\t\t   Press 0 to exit");
                Console.WriteLine();

                bool running = true;

                while (running)
                {
                    string userInput = Console.ReadLine();

                    switch (userInput)
                    {
                    case "1":
                        Console.Clear();
                        Console.WriteLine();
                        myHospital.EmployeeList();
                        Console.WriteLine();
                        Console.WriteLine();
                        myMenu.MainMenu();
                        break;

                    case "2":
                        Console.Clear();
                        Console.WriteLine();
                        myHospital.AllEmployeeStatus();
                        Console.WriteLine();
                        Console.WriteLine();
                        myMenu.EmployeeMenu();
                        //int ID = Convert.ToInt32(Console.ReadLine());
                        //myHospital.Trea(myHospital.AllPatients[ID]);
                        break;

                    case "3":
                        Console.Clear();
                        Console.WriteLine();
                        myHospital.PayAll();
                        Console.WriteLine();
                        Console.WriteLine();
                        myMenu.MainMenu();
                        Console.WriteLine();
                        break;

                    case "5":
                        Console.Clear();
                        Console.WriteLine();
                        myHospital.PatientList();
                        Console.WriteLine();
                        Console.WriteLine();
                        myMenu.MainMenu();
                        Console.WriteLine();
                        break;

                    case "6":
                        Console.Clear();
                        myHospital.PatientList();
                        Console.WriteLine();
                        Console.WriteLine("Select a patient by Patient ID.");
                        int index = Convert.ToInt32(Console.ReadLine());
                        int Id    = index - 1;
                        Console.WriteLine();
                        myHospital.DrawBlood(myHospital.AllPatients[Id]);
                        Console.WriteLine();
                        Console.WriteLine();
                        myMenu.MainMenu();
                        break;

                    case "7":
                        Console.Clear();
                        myHospital.PatientList();
                        Console.WriteLine();
                        Console.WriteLine("Select a patient by Patient ID.");
                        int index2 = Convert.ToInt32(Console.ReadLine());
                        int Id2    = index2 - 1;
                        Console.WriteLine();
                        myHospital.PatientCare(myHospital.AllPatients[Id2]);
                        Console.WriteLine();
                        Console.WriteLine();
                        myMenu.MainMenu();
                        break;

                    case "8":
                        Console.Clear();
                        Console.WriteLine();
                        receptionist.MakePhoneCall();
                        Console.WriteLine();
                        Console.WriteLine();
                        myMenu.MainMenu();
                        Console.WriteLine();
                        break;

                    case "9":
                        Console.Clear();
                        //myHospital.Sweep();
                        Console.WriteLine();
                        Console.WriteLine();
                        myMenu.MainMenu();
                        break;

                    case "0":
                        Console.Clear();
                        Console.WriteLine();
                        Console.WriteLine("\tThank you for using UniversityHospitals Employee and \n\tPatient Tracking system. Hit the enter button to exit");
                        Console.ReadKey();
                        Environment.Exit(0);
                        break;

                    default:
                        Console.WriteLine();
                        Console.WriteLine("\tPlease choose a valid selection.");
                        Console.ReadLine();
                        break;
                    }
                }
            }
        }