public IList <Booking> ListBookings(BookingFilter filter) { IList <Booking> bookings = List(); IList <Booking> selectedBookings = ListBookings(bookings, filter); return(selectedBookings); }
public string ListBookingsForCancellation(IUserProfile userProfile) { DateTime dateUtc = DateTime.UtcNow; BookingFilter filter = new BookingFilter(); filter.BookedFromUtc = dateUtc; filter.BookedToUtc = filter.BookedFromUtc.AddDays(180); filter.BookedBy = userProfile.UserName; IList <Booking> bookings = _bookingRepository.ListBookings(filter); AliceBookingCancellationSuggestionsParser parser = new AliceBookingCancellationSuggestionsParser(); string response = parser.Parse(bookings, userProfile); return(response); }
private IList <Booking> ListBookings(IList <Booking> bookings, BookingFilter filter) { IList <Booking> bookingsForSlot = new List <Booking>(); foreach (Booking booking in bookings) { if (filter.Filter(booking)) { if (!bookingsForSlot.Contains(booking)) { bookingsForSlot.Add(booking); } } } return(bookingsForSlot); }
private string ListBookings(DateTime date, string userName, IUserProfile userProfile) { DateTime localTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(date, userProfile.TimeZoneInfo.Id); DateTime dateUtc = localTime.Date.ToUniversalTime(); BookingFilter filter = new BookingFilter(); filter.BookedFromUtc = dateUtc; filter.BookedToUtc = filter.BookedFromUtc.AddHours(24); filter.BookedBy = userName; IList <Booking> bookings = _bookingRepository.ListBookings(filter); AliceBookingListParser parser = new AliceBookingListParser(); string response = parser.Parse(bookings, userProfile); return(response); }