Ejemplo n.º 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 choice)
        {
            switch (choice)
            {
            case "1":     // Do whatever option 1 is
                SetColor(ConsoleColor.Blue);
                campgrounds = (campgroundDAO.GetCampgroundsByParkID(park.Park_ID));
                Console.WriteLine(Campground.GetHeader());
                foreach (Campground campground in campgrounds)
                {
                    Console.WriteLine(campground.ToString());
                }
                ResetColor();
                //WriteError("Not yet implemented");
                Pause("");
                return(true);

            case "2":     // Do whatever option 2 is
                SubMenu2 submenu2 = new SubMenu2(park, campgroundDAO, siteDAO, reservationDAO);
                submenu2.Run();
                //WriteError("When this option is complete, we will exit this submenu by returning false from the ExecuteSelection method.");
                //Pause("");
                return(false);
            }
            return(true);
        }
        private void GetCampgrounds(int park_id)
        {
            IList<Campground> campgrounds = CampgroundDAO.GetCampgroundByParkId(park_id);

            Console.WriteLine(Campground.GetHeader());
            foreach (Campground campground in campgrounds)
            {
                Console.WriteLine(campground);
            }
  
        }
Ejemplo n.º 3
0
 protected override void BeforeDisplayMenu()
 {
     PrintHeader();
     SetColor(ConsoleColor.Blue);
     campgrounds = (campgroundDAO.GetCampgroundsByParkID(park.Park_ID));
     Console.WriteLine(Campground.GetHeader());
     foreach (Campground campground in campgrounds)
     {
         Console.WriteLine(campground.ToString());
     }
     ResetColor();
 }