Beispiel #1
0
 public static Booking Create(string contactId, DateTime date, TimePart startTime, TimeSpan length, Room room, Rate rate, Product product)
 {
     return new Booking
                {
                    MainContactId = contactId,
                    Date = date,
                    StartTime = startTime,
                    Length = length,
                    Rooms = new List<Room> { room },
                    Rate = rate,
                    Product = product
                };
 }
Beispiel #2
0
 public BookingList ForRoom(Room toCheck, DayOfWeek day)
 {
     var result = Bookings.Where(x => x.Rooms.Any(y => y.Id == toCheck.Id)).ToList();
     return new BookingList { Bookings = result, IsAWeekend = (day == DayOfWeek.Saturday || day == DayOfWeek.Sunday) };
 }