protected override bool ExecuteSelection(string choice) { // implement int campchoice = int.Parse(choice); ReservationMenu rem = new ReservationMenu(campchoice, chosen, ParkDAO, CampDAO, SiteDAO, ResDal); rem.Run(); return(true); }
/// <summary> /// Handle user menu choice /// </summary> /// <param name="choice">The user's selection</param> /// <returns>True to continue, false to go back to previous menu</returns> protected override bool ExecuteSelection(string choice) { switch (choice) { case "1": ReservationMenu resmenu = new ReservationMenu(MyParksDAO, MyCampgroundDAO, MySiteDAO, MyReservationDAO, MyPark); resmenu.Run(); return(true); case "2": return(false); } return(true); }
/// <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": // Display all parks with summary information ObjectListViews.DisplayParksDetailedView(parkDAO.GetAllParks()); Pause(""); return(true); case "2": // Display all the campgrounds at a selected national park by calling DisplayCampgroundByPark method DisplayCampgroundsByPark(); Pause(""); return(true); case "3": // Create and show the reservation sub-menu ReservationMenu rm = new ReservationMenu(parkDAO, campgroundDAO, siteDAO, reservationDAO); rm.Run(); return(true); } return(true); }
/// <summary> /// Handle user's menu selection here /// </summary> /// <param name="choice">String of user's menu selection</param> /// <returns>True to continue, false to return to previous menu</returns> protected override bool ExecuteSelection(string choice) { switch (choice) { case "1": // Show campgrounds at this park CampgroundMenu campmenu = new CampgroundMenu(MyParksDAO, MyCampgroundDAO, MySiteDAO, MyReservationDAO, MyPark); campmenu.Run(); return(true); case "2": // Search for a reservation (reservation menu not yet implemented) ReservationMenu resmenu = new ReservationMenu(MyParksDAO, MyCampgroundDAO, MySiteDAO, MyReservationDAO, MyPark); resmenu.Run(); return(true); case "3": return(false); } return(true); }
/// <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) { int inputNum = int.Parse(choice); Site site = new Site(); for (int i = 1; i <= siteList.Count; i++) { if (i == inputNum) { site = siteList[i - 1]; } } Console.Write($" Press Enter to complete reservation on Site Number {site.siteNumber}..."); Console.ReadLine(); ReservationMenu pgm = new ReservationMenu(campgroundDAO, campsiteDAO, parkDAO, reservationDAO, site, arrivalDate, departureDate); pgm.Run(); Pause(""); return(true); }