/// <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); }
/// <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); } }
/// <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); } }
/// <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); } }
/// <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()); }
/// <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); }
/// <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); }
/// <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)); }
/// <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)); }
/// <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)); }