Ejemplo n.º 1
0
        public void ReservationConfirmationForPark(string arrivalDate, string departureDate, int camp_id, int parkSelection)
        {
            SiteSqlDAL        site            = new SiteSqlDAL(databaseconnectionString);
            ReservationSqlDAL bookReservation = new ReservationSqlDAL(databaseconnectionString);

            Console.WriteLine();
            Console.Write("Which campground should be reserved? (enter 0 to cancel)  ");
            int campInput = CLI_Helper.GetInteger("==>");

            if (campInput == 0)
            {
                return;
            }

            Console.WriteLine();
            Console.Write("Which camp site should be reserved? (enter 0 to cancel)   ");
            int siteInput = CLI_Helper.GetInteger("==>");

            if (siteInput == 0)
            {
                return;
            }

            Console.WriteLine();
            Console.Write("Under what name should the reservation be held?  ");
            string inputName = Console.ReadLine();

            bookReservation.MakeReservation(parkSelection, site.GetSiteID(siteInput, camp_id), inputName, arrivalDate, departureDate);
            string reservationID = bookReservation.GetReservationId(inputName);

            Thread.Sleep(2000);
            Console.WriteLine();
            Console.WriteLine($"The reservation has been booked and the confirmation ID is: {reservationID}");
            Console.ReadLine();
        }
Ejemplo n.º 2
0
        public void GetSiteID()
        {
            SiteSqlDAL siteSqlDAL = new SiteSqlDAL(dbconnectionString);

            int testSite = siteSqlDAL.GetSiteID(4, 1);

            Assert.AreNotEqual(testSite, 0);
            Assert.AreEqual(4, testSite, "for CG 1, SN 4");

            int testSite2 = siteSqlDAL.GetSiteID(12, 2);

            Assert.AreEqual(24, testSite2, "for CG 2, SN 12");

            //int testSite3 = siteSqlDAL.GetSiteID(1000, 1000);
            //Assert.AreEqual(45, testSite3, "for CG 1000, SN 1000");
        }