Пример #1
0
        /// <summary>
        /// Gets a booking from the database.
        /// </summary>
        /// <param name="escapeRoomID">The EscapeRoom ID</param>
        /// <param name="username"> A Username from the user</param>
        /// <param name="BDate">The Date of the booking</param>
        /// <returns>The Booking</returns>
        public Booking GetBooking(int escapeRoomID, string username, DateTime BDate)
        {
            IBookingServices Service = new BookingServicesClient();

            try {
                Booking Book = Service.Get(escapeRoomID, username, BDate);
                return(Book);
            }
            catch (NullReferenceException NE) {
                Console.WriteLine(NE);
                Console.ReadLine();
                return(null);
            }
        }
Пример #2
0
        /// <summary>
        /// Search the database for one booking
        /// </summary>
        /// <param name="cus"></param>
        /// <param name="esr"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        public MAPMAClient.Model.Booking Get(MAPMAClient.Model.Customer cus, MAPMAClient.Model.EscapeRoom esr, DateTime date)
        {
            IBookingServices Service = new BookingServicesClient();

            try {
                var Booking = Service.Get(esr.EscapeRoomID, cus.Username, date);

                MAPMAClient.Model.Booking book;

                book = GetClientsideBooking(Booking);

                return(book);
            }
            catch (NullReferenceException NE) {
                Console.WriteLine(NE);
                Console.ReadLine();
                return(null);
            }
        }