コード例 #1
0
        public void DisplayReservations(int selectedParkId)
        {
            Console.Clear();
            IList <Reservation> reservations = reservationDAO.GetReservations(selectedParkId);

            Console.WriteLine("Campgound                       Site Number        From          To");
            foreach (Reservation reservation in reservations)
            {
                int    siteNumber     = siteDAO.GetSiteNumber(reservation.SiteId);
                string campgroundName = campgroundDAO.GetCampgroundName(reservation.SiteId);

                Console.WriteLine("{0,-30}       {1,-5}       {2,-10}    {3,-10}", campgroundName, siteNumber, (reservation.FromDate).ToString("yyyy/MM/dd"), (reservation.ToDate).ToString("yyyy/MM/dd"));
            }

            Console.WriteLine();
            Console.WriteLine("Press ENTER to go back.");
            Console.ReadLine();
            Console.Clear();
            ParkDescription();
            MainMenu();
        }