示例#1
0
        public void Get30DaysReservations(Park chosenPark)
        {
            IDictionary <Reservation, string> reservations = reservationDAO.Get30DaysReservations(DateTime.Now, chosenPark.ID);

            if (!(reservations is null))
            {
                Console.WriteLine("|{0,-8}|{1,-8}|{2,-25}|{3,-40}|{4,-15}|{5,-15}|{6,-15}|", "Res. ID.", "Site No.", "Camground", "Res. Name", "Start Date", "End Date", "Date Created");
                foreach (KeyValuePair <Reservation, string> kvp in reservations)
                {
                    Console.WriteLine($"|{kvp.Key.ID,8}|{kvp.Key.SiteID,8}|{kvp.Value,-25}|{kvp.Key.Name,-40}|{kvp.Key.FromDate.ToShortDateString(),-15}|{kvp.Key.ToDate.ToShortDateString(),15}|{kvp.Key.DateCreated.ToShortDateString(),15}|");
                }
            }