コード例 #1
0
ファイル: ViewParksMenu.cs プロジェクト: pattm0824/Main
        //Constructor to call in IDAO, Generate List using GetParks(), and Create our menu with parks list
        public ViewParksMenu(IParkDAO parkdao, ICampgroundDAO campgroundDAO, IReservationDAO reservationDAO, ISiteDAO siteDAO) : base()
        {
            this.parkdao        = parkdao;
            this.campgroundDAO  = campgroundDAO;
            this.reservationDAO = reservationDAO;
            this.siteDAO        = siteDAO;

            //parkdao, campgroundDAO, reservationDAO, siteDAO,

            try
            {
                parkList = parkdao.GetParks();

                this.Title = "****View Parks****";
                for (int i = 0; i < parkList.Count; i++)
                {
                    this.menuOptions.Add($"{i + 1}", $"{parkList[i].Name}");
                }
                this.menuOptions.Add("Q", "Quit");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"There was an error: {ex.Message}");
            }
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="selectedPark"></param>
 /// <param name="campgroundDAO"></param>
 /// <param name="siteDAO"></param>
 /// <param name="reservationDAO"></param>
 public ParkCLI(Park selectedPark, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO)
 {
     this.park           = selectedPark;
     this.campgroundDAO  = campgroundDAO;
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
 }
コード例 #3
0
 /// <summary>
 /// Constructor adds items to the top-level menu.
 /// </summary>
 public MainMenu(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO) : base("Main Menu")
 {
     this.parkDAO        = parkDAO;
     this.campgroundDAO  = campgroundDAO;
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
 }
コード例 #4
0
 public CapstoneCLI(ISiteDAO siteDAO, IParkDAO parkDAO, IReservationDAO reservationDAO, ICampgroundDAO campgroundDAO)
 {
     this.campgroundDAO  = campgroundDAO;
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
     this.parkDAO        = parkDAO;
 }
コード例 #5
0
 public ParksReservationCLI(IParkDAO parkDAO, ICampGroundDAO campGroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO)
 {
     this.reservationDAO = reservationDAO;
     this.parkDAO        = parkDAO;
     this.siteDAO        = siteDAO;
     this.campGroundDAO  = campGroundDAO;
 }
コード例 #6
0
 public ProjectCLI(ICampgroundDAO campgroundDAO, IParkDAO parkDAO, IReservationDAO reservationDAO, ISiteDAO siteDAO)
 {
     this.campgroundDAO  = campgroundDAO;
     this.parkDAO        = parkDAO;
     this.reservationDAO = reservationDAO;
     this.siteDAO        = siteDAO;
 }
コード例 #7
0
 public ParkService(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO)
 {
     this.ParkDAO        = parkDAO;
     this.CampgroundDAO  = campgroundDAO;
     this.SiteDAO        = siteDAO;
     this.ReservationDAO = reservationDAO;
 }
コード例 #8
0
 /// <summary>
 /// /
 /// </summary>
 /// <param name="park"></param>
 /// <param name="campgroundDAO"></param>
 /// <param name="siteDAO"></param>
 /// <param name="reservationDAO"></param>
 public CampgroundCLI(Park park, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO)
 {
     this.park           = park;
     this.campgroundDAO  = campgroundDAO;
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
 }
コード例 #9
0
 /// <summary>
 /// CLI constructor
 /// </summary>
 /// <param name="parkDAO">Park SQL DAO</param>
 /// <param name="campgroundDAO">Campground SQL DAO</param>
 /// <param name="siteDAO">Site SQL DAO</param>
 /// <param name="reservationDAO">Reservation SQL DAO</param>
 public NationalParkCLI(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO)
 {
     this.parkDAO        = parkDAO;
     this.campgroundDAO  = campgroundDAO;
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
 }
コード例 #10
0
 public CLI(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO, ISearchDAO searchDAO)
 {
     this.parkDAO        = parkDAO;
     this.campgroundDAO  = campgroundDAO;
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
     this.searchDAO      = searchDAO;
 }
コード例 #11
0
 public CampGroundCLI(IParksDAO parksDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO)
     : base(parksDAO, campgroundDAO, siteDAO, reservationDAO)
 {
     this.parksDAO       = parksDAO;
     this.campgroundDAO  = campgroundDAO;
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
 }
コード例 #12
0
 public CampgroundMenu(int chosen, ICampgroundDAO campDAO, IParkDAO parkDAO, ISiteDAO siteDAO, IReservationDAL resDal) : base("Campground")
 {
     this.chosen = chosen;
     CampDAO     = campDAO;
     ParkDAO     = parkDAO;
     SiteDAO     = siteDAO;
     ResDal      = resDal;
 }
コード例 #13
0
 public ParkInfoMenu(int chosen, ICampgroundDAO campp, IParkDAO parkDAO, ISiteDAO siteDAO, IReservationDAL reservationDAL) : base("Park Information")
 {
     this.chosen    = chosen;
     campDAO        = campp;
     ParkDAO        = parkDAO;
     SiteDAO        = siteDAO;
     ReservationDAL = reservationDAL;
 }
コード例 #14
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="parkDAO">DAO for parks table</param>
        /// <param name="campgroundDAO">DAO for campgrounds table</param>
        /// <param name="siteDAO">DAO for sites table</param>
        /// <param name="reservationDAO">DAO for reservation table</param>
        /// <param name="park">Object for a park that the user selected earlier</param>
        public CampgroundMenu(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO, Park park) :
            base(parkDAO, campgroundDAO, siteDAO, reservationDAO)
        {
            MyPark = park;

            this.menuOptions.Add("1", "Search for Available Reservation");
            this.menuOptions.Add("2", "Return to Previous Menu");
        }
コード例 #15
0
 //This is our constructor (reognize by having the same name as the class) and the string is the only argument that it accepts
 public CLIMenu(string connectionString)
 {
     // Initializing our properties to be used through the class (they need the connection string to conect to the database)
     parkDAO        = new ParkSqlDAO(connectionString);
     campDAO        = new CampgroundSqlDAO(connectionString);
     siteDAO        = new SiteSqlDAO(connectionString);
     reservationDAO = new ReservationSqlDAO(connectionString);
 }
コード例 #16
0
 /// <summary>
 /// Default constructor, pass in our DAO objects
 /// </summary>
 /// <param name="parkDAO">DAO for parks, created at start</param>
 /// <param name="campgroundDAO">DAO for campgrounds, created at start</param>
 /// <param name="siteDAO">DAO for campsites, created at start</param>
 /// <param name="reservationDAO">DAO for reservations, created at start</param>
 public CLIMenu(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO)
 {
     this.menuOptions = new Dictionary <string, string>();
     MyParksDAO       = parkDAO;
     MyCampgroundDAO  = campgroundDAO;
     MySiteDAO        = siteDAO;
     MyReservationDAO = reservationDAO;
 }
コード例 #17
0
 //private Campground Camp;
 //private Park Park;
 /// <summary>
 /// Constructor adds items to the top-level menu
 /// </summary>
 public ViewParksMenu(IParkDAO parkDao, ICampgroundDAO campDAO, ISiteDAO siteDAO, IReservationDAL reservationDAL) :
     base("ViewParksMenu")
 {
     ParkDAO        = parkDao;
     CampDAO        = campDAO;
     SiteDAO        = siteDAO;
     ReservationDAL = reservationDAL;
 }
コード例 #18
0
 public MainMenu(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, IReservationDAO reservationDAO, ISiteDAO siteDAO) : base("Main Menu")
 {
     // Set any private variables here.
     this.parkDAO        = parkDAO;
     this.campgroundDAO  = campgroundDAO;
     this.reservationDAO = reservationDAO;
     this.siteDAO        = siteDAO;
     //this.campground = campground;
 }
コード例 #19
0
 /// <summary>
 /// Constructor for ParkInfoMenu takes all the DAOs and the park selected from the Main menu
 /// </summary>
 public ParkInfoMenu(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, IReservationDAO reservationDAO, ISiteDAO siteDAO, Park park) :
     base("ParkInfoMenu")
 {
     this.parkDAO        = parkDAO;
     this.campgroundDAO  = campgroundDAO;
     this.reservationDAO = reservationDAO;
     this.siteDAO        = siteDAO;
     this.park           = park;
 }
コード例 #20
0
 public ReservationMenu(int campchoice, int chosen, IParkDAO parkDAO, ICampgroundDAO campDAO, ISiteDAO siteDAO, IReservationDAL resDal) : base("Reservations Menu")
 {
     this.campchoice = campchoice;
     this.chosen     = chosen;
     ParkDAO         = parkDAO;
     CampDAO         = campDAO;
     SiteDAO         = siteDAO;
     ResDal          = resDal;
 }
コード例 #21
0
 /// <summary>
 /// Constructor adds items to the top-level menu
 /// </summary>
 public SubMenu1(Park park, IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO) :
     base("Sub-Menu 1")
 {
     this.park           = park;
     this.ParkDAO        = parkDAO;
     this.CampgroundDAO  = campgroundDAO;
     this.SiteDAO        = siteDAO;
     this.ReservationDAO = reservationDAO;
 }
コード例 #22
0
 /// <summary>
 /// Constructor adds items to the top-level menu
 /// </summary>
 public SubMenu1(ISiteDAO siteDAO, IReservationDAO reservationDAO, IParkDAO parkDAO, ICampgroundDAO campgroundDAO /** DAOs may be passed in... ***/) :
     base("Sub-Menu 1")
 {
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
     this.parkDAO        = parkDAO;
     this.campgroundDAO  = campgroundDAO;
     // Store any values or DAOs passed in....
 }
コード例 #23
0
 /// <summary>
 /// Constructor adds items to the top-level menu. YOu will likely have parameters for one or more DAO's here...
 /// </summary>
 public MainMenu(IParkDAO parkDAO, ICampgroundDAO campDAO, ISiteDAO siteDAO, IReservationDAL resDal) : base("Main Menu")
 {
     //Camp = camp;
     //Park = park;
     this.parkDAO = parkDAO;
     this.campDAO = campDAO;
     this.siteDAO = siteDAO;
     this.resDal  = resDal;
 }
コード例 #24
0
        public MenuCLI(IParkDAO parkDAO, ISiteDAO siteDAO, ICampgroundDAO campgroundDAO, IReservationDAO reservationDAO)
        {
            this.parkDAO        = parkDAO;
            this.siteDAO        = siteDAO;
            this.campgroundDAO  = campgroundDAO;
            this.reservationDAO = reservationDAO;

            // Start main menu
            RunParkMenu();
        }
コード例 #25
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="parkDAO">DAO for parks table/param>
 /// <param name="campgroundDAO">DAO for campgrounds table</param>
 /// <param name="siteDAO">DAO for sites table</param>
 /// <param name="reservationDAO">DAO for reservations table</param>
 public ViewParksMenu(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO) :
     base(parkDAO, campgroundDAO, siteDAO, reservationDAO)
 {
     this.Title = "*** Select a Park for further Details ***";
     parks      = parkDAO.GetAllParks();
     for (int i = 0; i < parks.Count; i++)
     {
         this.menuOptions.Add((i + 1).ToString(), parks[i].Name);
     }
     this.menuOptions.Add("Q", "Quit");
 }
コード例 #26
0
 public NPSystemController(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO, IMainMenu mainMenu, IParkInfoMenu parkInfoMenu, IParkCampgroundsMenu parkCampgrounds, IReservationMenu reservationMenu)
 {
     this.parkDAO         = parkDAO;
     this.campgroundDAO   = campgroundDAO;
     this.siteDAO         = siteDAO;
     this.reservationDAO  = reservationDAO;
     this.mainMenu        = mainMenu;
     this.parkInfoMenu    = parkInfoMenu;
     this.parkCampgrounds = parkCampgrounds;
     this.reservationMenu = reservationMenu;
 }
コード例 #27
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="parkDAO">DAO for parks table</param>
 /// <param name="campgroundDAO">DAO for campgrounds table</param>
 /// <param name="siteDAO">DAO for sites table</param>
 /// <param name="reservationDAO">DAO for reservations table</param>
 /// <param name="park">Park that the user selected</param>
 public ViewParkInformationMenu(IParkDAO parkDAO, ICampgroundDAO campgroundDAO,
                                ISiteDAO siteDAO, IReservationDAO reservationDAO, Park park) :
     base(parkDAO, campgroundDAO, siteDAO, reservationDAO)
 {
     MyPark     = park;
     this.Title = "*** Select a command ***";
     this.menuOptions.Add("1", "View Campgrounds");
     this.menuOptions.Add("2", "Search for reservation");
     this.menuOptions.Add("3", "Return to previous screen");
     this.menuOptions.Add("Q", "Quit");
 }
コード例 #28
0
 //public int parkId;
 public ParkSubMenu(Park park, Campground campground, Site site, Reservation reservation, IParkDAO parkDAO, ICampgroundDAO campgroundDao, ISiteDAO siteDAO, IReservationDAO reservationDAO) :
     base("Sub-Menu 1")
 {
     // Store any values passed in....
     this.park           = park;
     this.parkDAO        = parkDAO;
     this.campgroundDAO  = campgroundDao;
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
     this.campground     = campground;
     this.site           = site;
 }
コード例 #29
0
        //Constructor that will generate the options menu
        public CampgroundsMenu(IParkDAO parkdao, ICampgroundDAO campgroundDAO, IReservationDAO reservationDAO, ISiteDAO siteDAO, Park referencePark)
        {
            this.parkdao        = parkdao;
            this.campgroundDAO  = campgroundDAO;
            this.reservationDAO = reservationDAO;
            this.siteDAO        = siteDAO;

            this.myPark = referencePark;
            Console.WriteLine("");
            this.Title = "****Select an Option****";
            this.menuOptions.Add("1", "Search For Available Campsites");
            this.menuOptions.Add("Q", "Return To Previous Screen");
        }
コード例 #30
0
        //Constructor that generates the option menu
        public ParkInformationMenu(IParkDAO parkdao, ICampgroundDAO campgroundDAO, IReservationDAO reservationDAO, ISiteDAO siteDAO, Park referencePark)
        {
            this.parkdao        = parkdao;
            this.campgroundDAO  = campgroundDAO;
            this.reservationDAO = reservationDAO;
            this.siteDAO        = siteDAO;

            this.myPark = referencePark;
            this.Title  = "****Select an Option****";
            this.menuOptions.Add("1", "View Campgrounds");
            this.menuOptions.Add("2", "Search for Reservations");
            this.menuOptions.Add("Q", "Return To Previous Screen");
        }