public IEnumerable <Room> GetAvailableRooms() { var busy = Reservations.Select(x => x.Id).ToList(); var rooms = Rooms.Where(x => !Reservations.Any(r => r.RoomId == x.Id)).ToList(); return(rooms); }
public string GetPeriods() { StringBuilder sb = new(); sb.Append('['); if (Reservations?.Any() ?? false) { foreach (var period in Reservations) { sb.Append($@"{{start: new Date(""{period.AccommodationDate:yyyy-MM-dd}""), end: new Date(""{period.ReleaseDate:yyyy-MM-dd}"")}},"); } sb.Remove(sb.Length - 1, 1); } sb.Append(']'); return(sb.ToString()); }
public bool HasExpiredTickets() { return(Reservations.Any(reservation => reservation.ExpiredBasketItemHistory)); }
public bool IsUserRegistered(string userName) { return(Reservations.Any(r => r.Attender.Equals(userName, StringComparison.InvariantCultureIgnoreCase))); }