Applies to uBooking 1.1 a newer

  • Namespace: uBooking.Core
  • Assembly: uBooking.Core.dll


Getting the service

The BookingService is available trough the UBookingContext.

var bookingService = UBookingContext.Current.Services.BookingService;


IBooking GetById(int id)

Get by id. The id is the primary key in the database, also used as a booking id for the customers

IBooking Create(IBooking booking)

Create Booking

IBooking Update(IBooking booking)

Update Booking

void Delete(IBooking booking)

Delete Booking

IEnumerable<IBooking> GetByDateRange(DateTime startDate, DateTime endDate)

Get a list of bookings between the given daterange

IEnumerable<IBooking> GetBookingsByResourceIdAndEnddate(int resourceId, DateTime endDate, bool approved)

Get a list of bookings by Resource id and enddate

bool IsAvailableBetweenArrivalDateLeavingDateResourceId(DateTime startDate, DateTime endDate, int resourceId, int? bookingId, bool checkInOut)

DATE BOOKING ONLY - Check if the given date is available between dates

bool IsAvailableByDateTimeAndResourceId(DateTime date, int resourceId, int? bookingId)

TIME BOOKING ONLY - Check if the given datetime is available

IEnumerable<IBooking> GetByFilter(IBookingFilterQuery query)

Get a list of filtered bookings

int CountByPaymentStatusId(int? paymentStatusId);

Count number of bookings by PaymentStatus id