Example #1
0
        /// <summary>
        /// This displays the Campground options for a given Park, selected by user
        /// </summary>
        /// <param name="parkId"></param>
        public List <int> ParkCampgrounds(int parkId)
        {
            Console.Clear();
            Header();
            CampgroundSqlDAL  campgroundDal = new CampgroundSqlDAL(DatabaseConnection);
            List <Campground> cmpgrds       = campgroundDal.GetParkCampgrounds(parkId);
            List <int>        campgroundIds = new List <int>();

            Console.WriteLine("Park Campgrounds");
            Console.WriteLine();
            Console.WriteLine($"{campId,7} | {name,19} | {opnMnth,10} | {closeMnth,10} | {dailyFee,9}");
            for (int i = 0; i < cmpgrds.Count; i++)
            {
                campgroundIds.Add(cmpgrds[i].CampgroundId);
                Console.WriteLine($"#{cmpgrds[i].CampgroundId,6} | {cmpgrds[i].Name,-19} | {cmpgrds[i].OpenFromMMStr,10} | {cmpgrds[i].OpenToMMStr,11} | {cmpgrds[i].DailyFee.ToString("c"),9}");
            }             // Iterates through the List of Campgrounds to display each to user
            Console.WriteLine();

            return(campgroundIds);
        }