Ejemplo n.º 1
0
        /// <summary>
        /// Calls the WCF, so the method Delete runs in the host and the choosen booking is deletet
        /// </summary>
        /// <param name="book"></param>
        public void Delete(MAPMAClient.Model.Booking book)
        {
            IBookingServices Service = new BookingServicesClient();


            Service.Delete(book.Emp.EmployeeID, book.Cus.Username, book.Er.EscapeRoomID, book.BookingTime, book.AmountOfPeople, book.Date);
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets a list with all the bookings in the database
        /// </summary>
        /// <returns></returns>
        public List <Model.Booking> GetAll()
        {
            IBookingServices Service = new BookingServicesClient();

            try {
                var bookings = Service.GetAll();
                return(GetClientSideBooking(bookings));
            }
            catch (NullReferenceException NE) {
                Console.WriteLine(NE);
                Console.ReadLine();
                return(null);
            }
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Gets all bookings from the database.
        /// </summary>
        /// <returns>List of all bookings</returns>
        public List <Booking> GetAllBookings()
        {
            IBookingServices Service = new BookingServicesClient();

            return(Service.GetAll());
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Deletes a Booking from the database.
        /// </summary>
        /// <param name="username"> A Username from the user</param>
        /// <param name="escapeRoomID">The EscapeRoom ID</param>
        /// <param name="BookTime">The Time for the booking</param>
        /// <param name="BDate">The Date of the booking</param>
        public void DeleteBookingCustomer(string username, int escapeRoomID, TimeSpan BookTime, DateTime BDate)
        {
            IBookingServices Service = new BookingServicesClient();

            Service.Deleteweb(username, escapeRoomID, BookTime, BDate);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Deletes a Booking from the database.
        /// </summary>
        /// <param name="EmployeeID"> An employees ID </param>
        /// <param name="username"> A Username from the user </param>
        /// <param name="escapeRoomID"> The EscapeRoom ID </param>
        /// <param name="BookTime">The Time for the booking </param>
        /// <param name="AmountOfPeople"> The Amount of people</param>
        /// <param name="BDate"> The Date of the booking</param>
        public void DeleteBooking(int EmployeeID, string username, int escapeRoomID, TimeSpan BookTime, int AmountOfPeople, DateTime BDate)
        {
            IBookingServices Service = new BookingServicesClient();

            Service.Delete(EmployeeID, username, escapeRoomID, BookTime, AmountOfPeople, BDate);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Creates Booking
        /// </summary>
        /// <param name="EmployeeID"> An employees ID</param>
        /// <param name="username"> A Username from the user</param>
        /// <param name="escapeRoomID">The EscapeRoom ID</param>
        /// <param name="BookTime"> The Time for the booking</param>
        /// <param name="AmountOfPeople">The Amount of people</param>
        /// <param name="BDate">The Date of the booking</param>
        /// <returns> returns 1 if succesful and returns 0 if failed.</returns>
        public int CreateBooking(int EmployeeID, string username, int escapeRoomID, TimeSpan BookTime, int AmountOfPeople, DateTime BDate)
        {
            IBookingServices Service = new BookingServicesClient();

            return(Service.Create(EmployeeID, username, escapeRoomID, BookTime, AmountOfPeople, BDate));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Gets all the users bookings.
        /// </summary>
        /// <param name="username"> A Username from the user</param>
        /// <returns>A List of all the customers booking</returns>
        public List <Booking> GetAllBookingFromUser(string username)
        {
            IBookingServices Service = new BookingServicesClient();

            return(Service.GetAllFromUser(username));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Calls the WCF, so the method Create runs in the host and a booking is createt and saved in the database
        /// </summary>
        /// <param name="book"></param>
        /// <returns></returns>
        public int Create(MAPMAClient.Model.Booking book)
        {
            IBookingServices Service = new BookingServicesClient();

            return(Service.Create(book.Emp.EmployeeID, book.Cus.Username, book.Er.EscapeRoomID, book.BookingTime, book.AmountOfPeople, book.Date));
        }