Beispiel #1
0
        public void RunCLI()
        {
            IList <Park> parks = parkDAO.GetParks();

            for (int i = 0; i < parks.Count; i++)
            {
                parksDict.Add(i + 1, parks[i]);
            }
            ViewParksInterface();
        }
        protected override void SetMenuOptions()
        {
            //this.menuOptions.Add("1", "Add 2 integers");
            //this.menuOptions.Add("2", "Menu option 2");
            //this.menuOptions.Add("3", "Go to a sub-menu");
            //this.menuOptions.Add("Q", "Quit program");
            SetColor(ConsoleColor.Yellow);
            IList <Park> parks = parkDAO.GetParks();
            int          sum   = 0;

            foreach (Park park in parks)
            {
                sum       += 1;
                menuNumber = Convert.ToString(sum);
                this.menuOptions.Add($"{menuNumber}", $"{park.Name}");
            }
            this.menuOptions.Add("Q", "Quit");
            this.quitKey = "Q";
            ResetColor();
        }
        /// <summary>
        /// This is the main interface for the reservation system
        /// </summary>
        /// <param name=""></param>
        public void ReservationInterface()
        {
            bool done = false;

            Parks = parkSqlDAO.GetParks();

            while (!done)
            {
                PrintHeader();

                DisplayHelper.DisplayParks(Parks);

                int choice = CLIHelper.GetInteger("\nPlease Enter the Park you would like information for (Or enter 0 to quit): ");

                if (choice != 0)
                {
                    ParkInfoMenu(choice - 1);
                }
                else
                {
                    done = true;
                }
            }
        }