Print Page | Close Window

Custom Provider & Schedules Object - Help

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=8841
Printed Date: 27 November 2024 at 6:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom Provider & Schedules Object - Help
Posted By: vbuser
Subject: Custom Provider & Schedules Object - Help
Date Posted: 20 November 2007 at 11:40am
I'm using a CustomProvider, how do you load the schedules? This is how I'm doing it:
 
Set rs = cnADO.Execute(sSQL, adCmdText)
    If Not (rs.BOF And rs.eof) Then
        rs.MoveFirst
        Do While Not rs.eof
            i = i + 1
            ReDim Preserve pRes(i)
            Set pRes(i) = New CalendarResource
            If i = 0 Then
                pRes(i).SetDataProvider2 strConnectionString, True
            Else
                pRes(i).SetDataProvider CalendarControl1.DataProvider, False  
            End If
            'add the schedule to the resource
            pRes(i).Name = rs!ShortName & ""
            pRes(i).ScheduleIDs.Add rs!EmployeeNo & ""
                          
            'add resource to resource array
            arResources.Add pRes(i)
      rs.MoveNext
    Loop
      
    End If
    rs.Close
    Set rs = Nothing
   'add resource array to calendarcontrol
   CalendarControl1.SetMultipleResources arResources
 
They showup OK on the calendar, but when I add an event the following code does not work:
 
'Fill schedules combobox
    Dim pSchedule As CalendarSchedule
    For Each pSchedule In frmPaneScheduler.CalendarControl1.DataProvider.Schedules
        cboSchedule.AddItem pSchedule.Name
        cboSchedule.ItemData(cboSchedule.NewIndex) = pSchedule.ID
    Next
   
 
any help will be appreciate it! Thank you
 
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net