![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 56
1998-2004 Gravitybox Software LLC
The RoomId field will create a unique key by which each room may be identified. The
Name field is the text that is displayed for a room on the schedule. Finally the
SortOrder field allows the user to control the order in which the rooms are displayed.
After adding a room the user may set the order in which each appears The table
structure, though simple, will serve our needed purpose of storing room configurations.
The other configuration table is the Category table. Each appointment may have an
associated category. This will appear as a colored bar in its left margin. This aids the
user in summarizing information about an appointment without having to look at a detail
screen. A category is nothing more than a name and a color. The table definition may
be defined as follows.
CategoryId AutoNumber
Name String
Color Long Integer
SortOrder Long Integer
The table is similar to the Room table with the addition of the Color field. This field is
used to store the numeric value of a color. This is the color of the category bars drawn
on the schedule to visually represents the category. This other fields serve the same
purposes as they do in the Room table, to provider a unique key, display name, and
order.
Finally the main table is named Schedule. This table will store all of the necessary
information for an appointment. The following fields define an appointment: Date,
StartTime, Length, Description, Room, and Category.
ScheduleId AutoNumber
StartDate Date
StartTime Time
Length Long Integer
Description String
RoomId Long Integer
CategoryId Long Integer
The ScheduleId field will create a unique key for this appointment. The RoomId
property is a pointer to the Room table. This will be a reference to some record in that
table. The CategoryId field does much the same. It references some record in the
Category table. The other properties are self-explanatory.
Loading Appointments
Now that the table structure is defined, we will build the code that accesses those tables
to load the schedule. After the user chooses a date to load, it is handed to a routine that
will open the database and retrieve the appropriate records. On the MDI child form the
LoadSchedule performs this action.
|