public void CampgroundInformationTest()
        {
            CampGroundDAL          thisCampground = new CampGroundDAL(connectionString);
            List <CampgroundModel> campgroundList = thisCampground.CampgroundsInPark("1");

            Assert.AreEqual(campGroundCount + 1, campgroundList.Count);
        }
Exemple #2
0
        public void ViewCampgrounds(string parkId)//creates and writes list of campground from the specified parkId then calls the campground menu
        {
            Console.Clear();
            CampGroundDAL          campground = new CampGroundDAL(connectionString);
            List <CampgroundModel> campList   = campground.CampgroundsInPark(parkId);

            Console.WriteLine("Search for Campground Reservation");
            Console.WriteLine();
            Console.WriteLine("Name".PadLeft(17) + "Open".PadLeft(29) + "Close".PadLeft(16) + "Daily Cost".PadLeft(18));
            for (int i = 0; i < campList.Count; i++)
            {
                if (parkId == campList[i].ParkId.ToString())
                {
                    Console.WriteLine(campList[i].ToString());
                }
            }
        }
Exemple #3
0
        public void AvailableSites(string campgroundID, string arrivalDate, string endDate)
        {
            Console.Clear();
            bool             ifTrue            = true;
            SiteDAL          sites             = new SiteDAL(connectionString);
            List <SiteModel> availableSiteList = sites.AvailableSiteSearch(campgroundID, arrivalDate, endDate);

            Console.WriteLine("Results Matching Your Search Criteria");
            Console.WriteLine("Site No." + "Max Occup.".PadLeft(20) + "Accessible?".PadLeft(20) + "Max RV Length".PadLeft(20) + "Utility".PadLeft(18) + "Cost".PadLeft(8));
            if (availableSiteList.Count == 0)
            {
                Console.WriteLine("No Sites Available!");
                ifTrue = false;
            }

            while (ifTrue)
            {
                CampGroundDAL          campground = new CampGroundDAL(connectionString);
                List <CampgroundModel> campList   = campground.CampgroundsInPark(userCampChoice);

                for (int i = 0; i < campList.Count; i++)//loops through the list of campgrounds to provide the total cost of reservation with campsite cost and reservation days
                {
                    if (campgroundID == campList[i].CampgroundId.ToString())
                    {
                        sitePrice = campList[i].DailyCost * (decimal)reservedDays;
                    }
                }

                for (int i = 0; i < availableSiteList.Count; i++)//loops through to show details of available sites
                {
                    if (campgroundID == availableSiteList[i].CampgroundId.ToString())
                    {
                        Console.WriteLine(availableSiteList[i].ToString() + sitePrice.ToString("C2"));
                    }
                }

                ReservationSiteSelection(arrivalDate, endDate);
                ifTrue = false;
            }
        }