Example #1
0
        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);
        }
Example #2
0
 private bool RentalEntryOverlap(RentalEntry entry, DateTime startDate, DateTime endDate)
 {
     return((entry.GetStartDate() <= endDate) && (startDate <= entry.GetEndDate()));
 }