コード例 #1
0
        public void ShowCampGrounds(List <Campground> list)
        {
            if (list.Count > 0)
            {
                Console.WriteLine("\n   " + "ID".PadRight(5) +
                                  "NAME".PadRight(40) +
                                  "Open    Close     DailyFee");

                foreach (Campground item in list)
                {
                    _db.AddDictionary(item.CampgroundID, item.DailyFeeMoney);
                    Console.WriteLine("   " + item.CampgroundID.ToString().PadRight(5) +
                                      item.Name.ToString().PadRight(42) +
                                      item.OpenMonth.ToString().PadRight(8) +
                                      item.CloseMonth.ToString().PadRight(8) +
                                      "$" + item.DailyFee.ToString());
                }
            }
            else
            {
                Console.WriteLine("There Are No Campgrounds In The Selected Park, Please Select A Different One.");
            }
        }