private void AddRentalEntry(int bikeId, RentalEntry entry) { this.rentalEntries.TryGetValue(bikeId, out List <RentalEntry> bikeRentalEntries); if (bikeRentalEntries == null) { bikeRentalEntries = new List <RentalEntry>(); } bikeRentalEntries.Add(entry); this.rentalEntries.Add(bikeId, bikeRentalEntries); }
private bool RentalEntryOverlap(RentalEntry entry, DateTime startDate, DateTime endDate) { return((entry.GetStartDate() <= endDate) && (startDate <= entry.GetEndDate())); }