Navigation bar
  Home Print document Start Previous page
 90 of 234 
Next page End  

Gravitybox Schedule Primer
Page 88 
1998-2004 Gravitybox Software LLC
This tells us that ScheduleItems(3) and ScheduleItems(4) have conflicts. Since there
are only two appointments in the group we know that they conflict with each other.
Next available slot
Before an appointment is added, you may wish to determine
if its addition will cause a conflict. There is a way to do this.
The GetNextFreeSlot method of the schedule may be used
in a variety of situations that require conflict checks. The method is used in the following
manner. Pass the parameters of date, room, start time and length and compare them
with the returned results. If the sent parameters match the return parameters, this space
it free, otherwise there was some appointment blocking the area. For example, if the
parameters Jun 3, 2002 at 10:00AM in Room1 checking for a 60 minute appointment
space are sent and the return values are the same date, time and room, there is no
other appointment present in this area of the schedule.
There are times when the automated calculation of free appointment slots is necessary.
In many cases, the user will drag-and-drop appointments to the desired position. If a
schedule is relatively empty, it is easy to spot a free area on which to place the
appointment. However finding a place for an appointment may not be so easy, if a
schedule is chiefly full. An appointment slot may not be readily visible. In this case, the
schedule will perform the grunt work. The GetNextFreeSlot method will take a number
of parameters to define exactly where to start the search. The method will then return
the first available slot, starting from the specified point, in which the specified
appointment of the desired length will fit. The parameters to this method are as follows.
Table 8.3
GetNextFreeSlot Parameters
GroupId
Specify a GroupId when you wish to find the next free slot for
a group of appointments. In general, this method if to find a
free slot for one appointment. However is may also be used to
find the next free slot of the first appointment of a Recurrence
group. You can assume that all appointments in the group will
have a free slot if all are move the relative distance from the
starting appointment in the group to the return value of the
method. For example, if the starting date/time for the group’s
starting appointment is Feb 3, 2004 10:00AM and the method
return value is Feb 5, 2004 2:00 PM, you may assume that
there is a free slot for all appointment in the group if they are
all moved 2 days and 4 hours (3120 minutes). If you do not
wish to search by group then leave this parameter blank.
StartDate
This is the date at which the search should begin. If in
RoomOnly mode, this parameter is ignored.
StartRoom
This is the room at which the search should begin. If in
DayOnly mode, this parameter is ignored.
Quick Tip
You may search for a free space on
a schedule by using the
“GetNextFreeSlot” method.
http://www.purepage.com