Пример #1
0
        public static void SearchForReservationByID()
        {
            while (true)
            {
                PrintTrees();
                Console.WriteLine("What is your reservation id? (0 to exit)");
                int reservationID = CLIHelper.GetInteger("Enter Id: ");
                if (reservationID == 0)
                {
                    Console.Clear();
                    MainMenu();
                }
                string customerName = CLIHelper.GetString("What is your name?");
                Console.WriteLine();

                if (campsiteDAL.FindReservationByID(reservationID, customerName, connectionString) != null)
                {
                    Console.Clear();
                    Console.WriteLine("Thank you! We found your reservation: ");
                    Console.WriteLine();
                    PrintReservationInformation(campsiteDAL.FindReservationByID(reservationID, customerName, connectionString));
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine($"{customerName} with a reservation id of {reservationID} is not in our system, please re-enter your information: ");
                    SearchForReservationByID();
                }
            }
        }
Пример #2
0
        public void FindReservationByName()
        {
            Reservation r = s.FindReservationByID(2, "Lockhart Family Reservation", connectionString);

            string dateRange = r.FromDate.ToString() + ", " + r.ToDate.ToString();
            string resName   = r.Name;
            int    siteId    = r.SiteID;

            Assert.IsNotNull(r);
            Assert.AreEqual("Lockhart Family Reservation", resName);
            Assert.AreEqual(1, siteId);
            Assert.AreEqual("2/19/2018 12:00:00 AM, 2/22/2018 12:00:00 AM", dateRange);
        }