Navigation bar
  Print document Start Previous page
 55 of 90 
Next page End  

Gravitybox Schedule.NET
1998-2005 Gravitybox Software LLC
Page 53 of 90
Chapter 6
Advanced Functionality
Overview
The schedule in addition to holding and displaying data also has advanced querying
abilities. The storage of information is not very useful if there is not a way to easily sort
and query the information. The collections and lists expose methods to extract specific
information from what may be a vast set of data. You can produce subsets of
information and perform set arithmetic operations to derive even more specific sets of
information.
Searching
One of the most useful things about the defined lists is their ability to return objects from
their complementary collections based on querying information. The
AppointmentCollection has an overloaded Find method that returns a subset of
appointments based on some search criteria. The CategoryCollection and
ProviderCollection classes have only basic functionality as they can only search by text.
Both of these object types are really nothing more than a piece of text and a color, so
there is really nothing much on which to search. The real search functionality is built into
the AppointmentCollection. Each appointment has many properties and as such you will
want to find objects by different criteria.
Let us look at a real-world example. In a doctor’s office you may wish to find all
appointments in a date range. The following code snippet will returns a list of
appointments between January 1, 2004 and January 5, 2004, inclusive.
Dim list1 As Gravitybox.Objects.AppointmentList
list1 = Schedule1.AppointmentCollection.Find(#1/1/2004#, #1/5/2004#)
This is useful if you wish to provide functionality to a user to query appointments by
date. You could retrieve a date range from the user in a custom dialog and then, after
querying the AppointmentCollection, display the results on screen in a listview control
perhaps. This ensures that you do not have to go re-query your database for
information that you have already have.
This functionality is useful in and of itself; however in the real world you will most likely
need to construct much more complicated queries. Following the example above, image
that you wish to find all appointment in that date range for “John Doe”. Let’s assume
that a patient’s name is displayed in appointment’s Subject property. Now following the
example above we search by Subject. This new list consists of all the appointments for
John Doe.
Dim list2 As Gravitybox.Objects.AppointmentList
List2 = Schedule1.AppointmentCollection.Find(“John Doe”)
http://www.purepage.com