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

Gravitybox Schedule Primer
Page 142 
1998-2004 Gravitybox Software LLC
  'Every day has these rooms since every day
  'we have the same number of rooms in our office
  Call Schedule1.Rooms.Clear
  Call Schedule1.Rooms.Add("Operatory I")
  Call Schedule1.Rooms.Add("Operatory II")
  Call Schedule1.Rooms.Add("Exam I")
  Call Schedule1.Rooms.Add("Exam II")
End Sub
Now that we know the rooms will be added, we need to write a routine to open and save
files. This application will not use any database access. It will use the built-in XML file
routines. The OpenFile and SaveFile routines will load and save schedules to XML files.
Public Function OpenFile(ByVal dtDate As Date) As Boolean
Dim oXMLParameters As CXMLParameters
Dim sFileName As String
  
  'Save this screen's date
  MyDate = dtDate
  'This will load a schedule from file (if need be)
  sFileName = AppPath & GetFileName(Me.MyDate)
  If FileExists(sFileName) Then
    Set oXMLParameters = New CXMLParameters
    oXMLParameters.FileName = sFileName
    oXMLParameters.EmployGMT = False
    oXMLParameters.PropertyAll = False
    Call oXMLParameters.UseAllCollections(False)
    oXMLParameters.VerifyOnly = False
    Call Schedule1.ScheduleItems.Clear
    Call Schedule1.ImportXML(oXMLParameters)
  End If
  
  'Setup the caption for this screen
  Me.Caption = Format(MyDate, "dddd mmm dd, yyyy")
  
  'There is nothing dirty
  Changed = False
EndSub:
  Set oXMLParameters = Nothing
End Function
Public Sub SaveFile()
http://www.purepage.com