![]() Gravitybox Schedule.NET
1998-2005 Gravitybox Software LLC
Page 64 of 90
'Mark the 'appointment_guid' column as a unique key
dt.Columns("appointment_guid").Unique = True
This empty dataset can be bound to the schedule as follows, where the name of the
schedule is Schedule1.
'Bind the dataset to the schedule
Schedule1.DataSource = ds
Schedule1.Bind()
When the schedule is bound, all appointments on the schedule are cleared, so be sure
there are no appointments that you need. After the AppointmentCollection is cleared the
newly bound dataset is used to populate the schedule. In the example above, the
dataset is empty so no new appointments are created. The dataset always reflects the
state of the schedule. This means that as the user operates on an appointment by add
remove, move, etc, the dataset is updated. The opposite is also true. If the dataset is
modified outside of the schedule while it is bound, the changes will be reflected on the
schedule as well. This means that you can commit the dataset back to your database at
any time and the changes will be current.
This also creates an interesting corollary. If a dataset is bound to two or more schedules
simultaneously, all schedules will be synchronized at all times. This occurs because if
one schedule is changed it updates the bound dataset. However since the dataset is
bound to another schedule, the second schedule is notified that the dataset was
updated and the second schedule is updated as a result. This functionality allows you to
synchronize multiple schedules simply by binding each to the same dataset.
Appointment Data Table
Field
Data Type
Required / Non-Null
Appointment_Guid
String
Yes (pk)
Start_Date
DateTime
Yes
Length
Integer
Yes
Blockout
Boolean
No
IsEvent
Boolean
No
IsFlagged
Boolean
No
IsReadOnly
Boolean
No
MaxLength
Integer
No
MinLength
Integer
No
Notes
String
No
Priority
Integer
No
Recurrence_Guid
String
No
Room_Guid
String
No
Subject
String
No
Text
String
No
ToolTipText
String
No
Visible
Boolean
No
Alarm_Window_Text
String
No
|