public ParksReservationCLI(IParkDAO parkDAO, ICampGroundDAO campGroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO)
 {
     this.reservationDAO = reservationDAO;
     this.parkDAO        = parkDAO;
     this.siteDAO        = siteDAO;
     this.campGroundDAO  = campGroundDAO;
 }
예제 #2
0
        public MakeReservationMenu(IReservationDAO resDaoParam, Campground campground, DateTime arrival, DateTime departure)
            : base()
        {
            this.reservationDAO = resDaoParam;
            this.Campground     = campground;
            this.Arrival        = arrival;
            this.Departure      = departure;
            this.AvailableSites = reservationDAO.GetAvailableSites(arrival, departure, this.Campground.Campground_Id);

            this.Title = "Results matching your search criteria:";
            // This if statement displays a message letting the user know that no sites were found and sets
            // the "FoundReservations" property to false.
            if (this.AvailableSites.Count == 0)
            {
                this.FoundReservations = false;
                Console.WriteLine("Unfortunately, all sites at that campground are booked during your requested dates.");
                Console.WriteLine("Please select from one of our other amazing campgrounds.");
                Pause("");
            }
            else
            {
                this.FoundReservations = true;
                foreach (Site site in this.AvailableSites)
                {
                    //creates strings to hold a yes/no value for the two boolean fields
                    string accessible = site.Accessible ? "Yes" : "No";
                    string utilities  = site.Utilities ? "Yes" : "No";
                    this.menuOptions.Add(site.Site_Number.ToString("00"),
                                         $"     {site.Max_Occupancy,-14} {accessible,-15}{site.Max_Rv_Length,-15}{utilities,-9}" +
                                         $"{this.Campground.Daily_Fee * (departure - arrival).Days,7:C}");
                }
            }
            this.menuOptions.Add("Q", " ");
            Console.WriteLine();
        }
 /// <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;
 }
예제 #4
0
 public MainMenuCLI(IParkDAO parkDAO, ICampGroundDAO campGroundDAO, ICampSiteDAO campSiteDAO, IReservationDAO reservationDAO)
 {
     this.parkDAO        = parkDAO;
     this.campGroundDAO  = campGroundDAO;
     this.campSiteDAO    = campSiteDAO;
     this.reservationDAO = reservationDAO;
 }
예제 #5
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;
 }
예제 #6
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;
 }
 public ProjectCLI(ICampgroundDAO campgroundDAO, IParkDAO parkDAO, IReservationDAO reservationDAO, ISiteDAO siteDAO)
 {
     this.campgroundDAO  = campgroundDAO;
     this.parkDAO        = parkDAO;
     this.reservationDAO = reservationDAO;
     this.siteDAO        = siteDAO;
 }
 /// <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;
 }
예제 #9
0
 public ReservationController(IAuthProvider authProvider, IPetDAO petDAO, IUserDAL userDAL, IReservationDAO reservationDAO)
 {
     this.authProvider   = authProvider;
     this.petDAO         = petDAO;
     this.userDAL        = userDAL;
     this.reservationDAO = reservationDAO;
 }
예제 #10
0
 public ParkService(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, ISiteDAO siteDAO, IReservationDAO reservationDAO)
 {
     this.ParkDAO        = parkDAO;
     this.CampgroundDAO  = campgroundDAO;
     this.SiteDAO        = siteDAO;
     this.ReservationDAO = reservationDAO;
 }
예제 #11
0
        //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}");
            }
        }
예제 #12
0
 public CapstoneCLI(ISiteDAO siteDAO, IParkDAO parkDAO, IReservationDAO reservationDAO, ICampgroundDAO campgroundDAO)
 {
     this.campgroundDAO  = campgroundDAO;
     this.siteDAO        = siteDAO;
     this.reservationDAO = reservationDAO;
     this.parkDAO        = parkDAO;
 }
예제 #13
0
 public PurchaseController(IReservationDAO resParam, IFilmDAO filmParam, IShowTimeDAO stParam, IAuthProvider authProvider, IUserDAL userDAO)
 {
     this.ResDAO       = resParam;
     this.FilmDAO      = filmParam;
     this.ShowTimeDAO  = stParam;
     this.authProvider = authProvider;
     this.userDAO      = userDAO;
 }
 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;
 }
예제 #15
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;
 }
예제 #16
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;
 }
예제 #17
0
 public UserInterface(string connectionString)
 {
     this.connectionString = connectionString;
     venueDAO       = new VenueSqlDAO(connectionString);
     cityDAO        = new CitySqlDAO(connectionString);
     spaceDAO       = new SpaceSqlDAO(connectionString);
     reservationDAO = new ReservationSqlDAO(connectionString);
 }
예제 #18
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);
 }
 /// <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;
 }
예제 #20
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;
 }
예제 #21
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....
 }
 /// <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;
 }
예제 #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(ICampgroundDAO campgroundDAO, ICampsiteDAO campsiteDAO, IParkDAO parkDAO, IReservationDAO reservationDAO) : base("Main Menu")
        {
            this.campgroundDAO  = campgroundDAO;
            this.campsiteDAO    = campsiteDAO;
            this.parkDAO        = parkDAO;
            this.reservationDAO = reservationDAO;

            //this.cityDAO = cityDAO;
            //this.countryDAO = countryDAO;
        }
예제 #24
0
 /// <summary>
 /// Constructor adds items to the top-level menu
 /// </summary>
 public ParkCampgroundsMenu(ICampgroundDAO campgroundDAO, ICampsiteDAO campsiteDAO, IParkDAO parkDAO, IReservationDAO reservationDAO, Campground campground) :
     base("Sub-Menu 1")
 {
     // Store any values or DAOs passed in....
     this.campgroundDAO  = campgroundDAO;
     this.campsiteDAO    = campsiteDAO;
     this.parkDAO        = parkDAO;
     this.reservationDAO = reservationDAO;
     this.campground     = campground;
 }
 /// <summary>
 /// Constructor adds items to the top-level menu
 /// </summary>
 public ParkInfoMenu(ICampgroundDAO campgroundDAO, ICampsiteDAO campsiteDAO, IParkDAO parkDAO, IReservationDAO reservationDAO, Park park) :
     base("ParkInfoMenu")
 {
     // Store any values or DAOs passed in....
     this.campgroundDAO  = campgroundDAO;
     this.campsiteDAO    = campsiteDAO;
     this.parkDAO        = parkDAO;
     this.reservationDAO = reservationDAO;
     this.park           = park;
 }
 public ParksMenu(IParkDAO parkDAO, ICampgroundDAO campgroundDAO, IReservationDAO reservationDAO, ISiteDAO siteDAO) : base(parkDAO, campgroundDAO, reservationDAO, siteDAO)
 {
     this.Title = "List of park names";
     parks      = parkDAO.GetParks();
     for (int i = 0; i < parks.Count; i++)
     {
         this.menuOptions.Add($"{i + 1}", $"{parks[i].Name}");
     }
     this.menuOptions.Add("Q", "Quit");
 }
예제 #27
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();
        }
예제 #28
0
        public ParkInformationMenu(ICampgroundDAO campground, IReservationDAO reservation, Park park) : base()
        {
            this.campgroundDAO  = campground;
            this.reservationDAO = reservation;
            this.park           = park;


            this.Title = "Park Information Screen";
            this.menuOptions.Add("1", "View Campgrounds to Search for Reservation");
            this.menuOptions.Add("Q", "Return to Main Menu");
        }
예제 #29
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;
 }
예제 #30
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");
 }