Exemplo n.º 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);
            }
        }
        /// <summary>
        /// Get the details of the Facility View in the Model Facility such as FacilityList, list of countries etc.
        /// </summary>
        /// <returns>
        /// returns the actionresult in the form of current object of the Model Facility to be passed to View Facility
        /// </returns>
        public ActionResult Index()
        {
            //Initialize the Facility Communicator object
            var facilityBal = new FacilityBal();

            //Get the facilities list
            var cId = Helpers.GetDefaultCorporateId();
            //var facilityList = facilityBal.GetFacilities(cId);
            var facilityList = facilityBal.GetFacilityList(cId);

            //Intialize the View Model i.e. FacilityView which is binded to Main View Index.cshtml under Facility
            var facilityView = new FacilityView
            {
                FacilityList    = facilityList,
                CurrentFacility = new Facility()
                {
                    CorporateID = Helpers.GetSysAdminCorporateID()
                }
            };

            //Pass the View Model in ActionResult to View Facility
            return(View(facilityView));
        }
Exemplo n.º 3
0
        protected void ProcessFacility(Event evt)
        {
            FacilityRepo    _repo       = new FacilityRepo();
            List <Facility> _facilities = _repo.GetAll().Cast <Facility>().ToList();
            int             _count      = _facilities.Count();

            Console.WriteLine();

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

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

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

                if (_option == _count + 1)
                {
                    FacilityView _fv = new FacilityView();
                    _fv.Add(evt.Facility);
                }
                else
                {
                    --_option;                                      // Decrement _option to accommodate zero-based indexing
                    evt.Facility = _facilities[_option];
                }
            }
            else
            {
                FacilityView _fv = new FacilityView();
                _fv.Add(evt.Facility);
            }
        }