Issue with "Search by date"

*Warning: Searching vehicle by available date needs work on the GitHub.

Current search logic implementation based on using the search bar.

  1. Start with a full list of vehicles.

  2. Filter list of vehicles from simple queries first. Ex. ("suv"==car types), (50,000<=mileage).

  3. When client uses Date-from and Date-to to search for available vehicles, make a new list where this logic is True. booking Date-to >= rented Date-from is True.

  4. Next, filter the list of vehicles where booking Date-from <= rented Date-to is True.

  5. The list from steps #3 and 4 now has a list of unavailable vehicles.

  6. Get the final list by: (Filtered list of vehicles) - (list of unavailable vehicles).

  7. Show the list of available vehicles to booking client.

Step 3

Step 4

Purple is our booking client. Client booking for a specific date, wants list of vehicles available to rent.

Blue are the vehicles unavailable. Due to overlapping booking schedules.

Green are the vehicles available. But also returns True with the vehicles in blue for this case.

So how do we differentiate the vehicles in blue, but return the ones in green for our client?

By verifying both Step 3 and 4 are True! This way we can account for vehicles that are booked outside our booked range, Ex. Other Customer 4.

Cases like "Other Customer 4" are also the reason we cannot simply look for vehicles booked between booking Date-from and Date-to.

Steps 3 and 4 will produce a list of unavailable vehicles.

Where

(Filtered list of vehicles) - (list of unavailable vehicles) = available vehicles

Visuals for step 3 and 4

*Note: this list returns unavailable cars for rent

Customer 1, 2, 3, 4 = True

Customer 1 = True

Customer 2 = False

Customer 1, 2, 3, 4 = True

Customer 1 = False

Customer 2 = True

Software Information
  • SQL express (64 bit), ver. 16.0.1121 RTM

  • .NETFramework ver. 4.7.2

  • UI WinForms

Functionality
  • Adding, removing cars, employees and customers are functional.

  • Searching by any search boxes also works.

  • Adding transactions is also functional.

Entity Relationship Diagram

Login Screen for Employees

Employee Screen for Car Rentals

Search Car By Branch

Search Car By Car Type

Add Customer

Add Employees

Add Rental Transactions

Main Windows

Process to book a car

Secondary window will pop up after filling in information on main window (bottom)

Customer, employee and car information will auto-fill for convenience

Confirmation window will show up, print window is available after for customer