public EventBookingsO GetEventBookingOnBookingId(int id) { try { return(EventBookingsAccessorO.FetchEventBookings(id)); } catch (Exception) { // *** we should sort the possible exceptions and return friendly messages for each throw; } }
/// <summary> /// Updates the event booking. /// </summary> /// <param name="eventBooking">The event booking.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public bool UpdateEventBooking(EventBookingsO eventBooking) { try { //CustomerAccessor.UpdateCustomer(customer) >= 1) if (EventBookingsAccessorO.UpdateEventBookings(eventBooking) >= 1) { return(true); } else { return(false); } } catch (Exception) { throw; } }
/// <summary> /// Inserts the new event booking. /// </summary> /// <param name="eventTypeID">The event type identifier.</param> /// <param name="startTime">The start time.</param> /// <param name="endTime">The end time.</param> /// <param name="eventDate">The event date.</param> /// <param name="venueID">The venue identifier.</param> /// <param name="customerID">The customer identifier.</param> /// <param name="catererID">The caterer identifier.</param> /// <param name="userID">The user identifier.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public bool InsertNewEventBooking(int eventTypeID, TimeSpan startTime, TimeSpan endTime, DateTime eventDate, int venueID, int customerID, int catererID, int userID) { try { var eventBookingsO = new EventBookingsO() { BookingID = 0, EventTypeID = eventTypeID, VenueID = venueID, CustomerID = customerID, CaterersID = catererID, UserProfileID = userID, StartTime = startTime, EndTime = endTime, EventDate = eventDate }; if (EventBookingsAccessorO.InsertEventBookings(eventBookingsO) != 0) { return(true); } } catch (Exception) { throw; } return(false); }