Exemple #1
0
        protected void DisplayCurrentData(Event evt)
        {
            Console.WriteLine($"Name: {evt.Name}");
            Console.WriteLine($"Occurred on {evt.StartDate}");
            Console.WriteLine($"Ended on {evt.EndDate}");

            if (evt.Inpatient)
            {
                Console.WriteLine("You were admitted into a facility");
            }
            else
            {
                Console.WriteLine("You were not admitted into a facility");
            }

            if (evt.ERVisit)
            {
                Console.WriteLine("You went to the emergency room");
            }
            else
            {
                Console.WriteLine("You did not go to the emergency room");
            }

            if (evt.DROffice)
            {
                Console.WriteLine("You went to the doctor's office");
            }
            else
            {
                Console.WriteLine("You did not go to the doctor's office");
            }

            if (evt.Physician != null)
            {
                PhysicianView _pv = new PhysicianView();
                _pv.Display(evt.Physician);
            }

            if (evt.Facility != null)
            {
                FacilityView _fv = new FacilityView();
                _fv.Display(evt.Facility);
            }
        }
Exemple #2
0
        protected void ProcessPhysician(Event evt)
        {
            PhysicianRepo    _repo    = new PhysicianRepo();
            List <Physician> _doctors = _repo.GetAll().Cast <Physician>().ToList();
            int _count = _doctors.Count();

            Console.WriteLine();

            if (_count > 0)
            {
                for (int i = 0; i < _count; i++)
                {
                    Console.WriteLine($"{i + 1} {_doctors[i]}");
                }

                Console.WriteLine($"{_count + 1} Add a physician");
                Console.WriteLine();

                int _option = GetOption("Please enter your selection: ", _count + 1);

                if (_option == _count + 1)
                {
                    PhysicianView _pv = new PhysicianView();
                    _pv.Add(evt.Physician);
                }
                else
                {
                    --_option;                                      // Decrement _option to accommodate zero-based indexing
                    evt.Physician = _doctors[_option];
                }
            }
            else
            {
                PhysicianView _pv = new PhysicianView();
                _pv.Add(evt.Physician);
            }
        }