jimmy said:
Yes this is, i have completed the other parts of the project (stock
management and actually storing the reservations in a database and
searching etc) but i cant get my head around how to do this.
So you can store the reservations in the database? I assume that you
have some way to information about the tables such as number of
parties, whether it's a booth or a table, whether it's near a window or
not, whether it's close to the stage (if there is a stage), etc. So a
reservation would be a table for a specific time?
So, how do you envision the program working? Will someone call to
request a reservation? If they ask for a table for 4, near a window,
for 8:00pm, you will have to query your associated database for a table
that matches that description. Then based on the data stored in the
reservations table, you can check to see if a reservation already
exists for that table at that time. A possible db setup might include
the following:
DinnerTable (holds information about the available tables)
Id int
Capacity int
Type int -- 0 = table, 1 = booth
NearWindow bit
Reservations
Id int
DinnerTableId int --FK to Tables table
Time datetime
Duration int --Length of the reservation in
minutes
These are only simple examples to help you start thinking.
Your queries would have to be able to figure out which tables are
reserved (or still in use), which tables are likely to be vacated, and
which tables are free.
If a party is using a table at 8:00pm and someone calls to reserve that
table for 9:00pm, can you put that down as a reservation even though
the first party might linger at the table past 9pm? Or would you tell
the caller that that table is reserved for 8pm and it might not be free
exactly at 9pm and that they may have to wait until 9:15? These are
things to consider.
And you'll probably need a way to cancel a reservation.
Break the program into small tasks and begin solving each of those
tasks, keeping in mind all of the requirements for the project.
Hope there is at least some useful nuggets of information in here for
you.
Good Luck.