Logic problem

rcooper

Newcomer
Joined
Jun 24, 2003
Messages
1
I am in my last class for a software developer degree and try as we might, my team cannopt figure this out.

We are making reservations for heavy equipment. We have a value that keeps the "rental status" and it can be :

Available
Reserved
Rented
Maitenance

The problem is, we can figure out how to make an advance reservation. We cannot make a reservation for a month from now but keep the equipment available until the time of the reservation.

I really don't need code, but rather a methodology on how to accomplish this.

We are using VB.net and DB2

Thanks,

Coop
rcooper@uark.edu
 
I don't know if I understand the question properly...

I would think you would need a place (field in a database or whatever) to store the length or end-date of the reservation; when you set one of the States to 'Reserved', also set the length to '31' or to '7-24-2003' or whatever field you used.

Then just don't allow any of the equipment whose state is 'Reserved' and whose length criteria have not yet been met.



I'm sorry if I misunderstood what you're trying to do...
 
As VolteFace said.
Your information can not be condensed to a simple "status". You might actually be looking for a set of:
a) Status (Reserved, Rented, Maintenance). [Status Available is redundant]
b) BeginOfTimespan
c) End of Timespan.

Now, whenever someone wants to make a reserveration, just check that for this piece of equipment, there is no status-info that either start before the end of the requested reservation or ends after the start of the requested reservation.
 
I would think you need two separate tables:

1) Equipment table
2) Availability table (ActionType, EquipId, BeginTime, EndTime)

The ActionType is Reserved, Rented, Maintenance. It would default to available. When you want to book a reservation or for maintenance, you check the availibility table for the date specified + the time needed to determine if that time period is available.
 
Back
Top