Пример #1
0
        /// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string Selection)
        {
            List <Park> parks  = parkDAO.GetParks();
            int         parkId = 0;

            parkId = int.Parse(Selection);

            Console.Clear();

            Park park = null;

            foreach (Park p in parks)
            {
                if (p.Id == parkId)
                {
                    park = p;
                    break;
                }
            }

            ParkInfoMenu sm = new ParkInfoMenu(parkDAO, campgroundDAO, reservationDAO, siteDAO, park);

            sm.Run();

            return(true);
        }
Пример #2
0
        /// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string choice)
        {
            if (choice.ToUpper() == "Q")
            {
                System.Environment.Exit(0);
            }

            List <Park> parkSelection = parkDAO.GetParks();

            int  inputNum = int.Parse(choice);
            Park park     = parkSelection[inputNum - 1];

            ParkInfoMenu sm = new ParkInfoMenu(campgroundDAO, campsiteDAO, parkDAO, reservationDAO, park);

            sm.Run();
            return(true);
        }
        protected override bool ExecuteSelection(string choice)
        {
            switch (choice)
            {
            case "Q":
                break;

            default:
                int  index = int.Parse(choice) - 1;
                Park park  = parkList.ElementAt(index);
                DisplayInfoForPark(park);
                ParkInfoMenu menu = new ParkInfoMenu(parkDAO, park);
                menu.Run();
                break;
            }

            return(true);
        }
Пример #4
0
        /// <summary>
        /// The override of ExecuteSelection handles whatever selection was made by the user.
        /// This is where any business logic is executed.
        /// </summary>
        /// <param name="choice">"Key" of the user's menu selection</param>
        /// <returns></returns>
        protected override bool ExecuteSelection(string choice)
        {
            List <Park> parks = ParkDAO.GetParks();
            //locate park that matches id typed
            int  chosen     = Convert.ToInt32(choice);
            Park chosenPark = null;

            foreach (Park park in parks)
            {
                if (chosen == park.ParkID)
                {
                    chosenPark = park;
                    break;
                }
            }
            ParkInfoMenu pif = new ParkInfoMenu(chosen, CampDAO, ParkDAO, SiteDAO, ReservationDAL);

            pif.Run();

            return(true);
        }