Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Mutilple Schedules
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mutilple Schedules

 Post Reply Post Reply
Author
Message
mri0202 View Drop Down
Newbie
Newbie


Joined: 07 October 2009
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote mri0202 Quote  Post ReplyReply Direct Link To This Post Topic: Mutilple Schedules
    Posted: 05 March 2012 at 8:05am
Hi all,

In December 2011 I wrote to support because of a problem with 'multiple schedules' (



Issue # 27795.

Because I got no answer until yet, I hope someone in the forum can help me.

We have a custom database for saving calandar events. In our application it is possible, that a couple of people share one event.
I've modified the example for ''multiple ressources'' for Visual Basic.

- One schedule for every involved person
- I clone the event
- I change the schedule-Id of the cloned event.

The problem is, that lets say four people share one event, only the first and the last is shown up in the calendar.
What am I doing wrong.

Thanks in advance

Manfred Richter



Code snippet

	' Remove all resources
    CalendarControl.MultipleResources.RemoveAll
    fAnzMKzNameTab = Split(sMKzNamen, Chr(254))
    fAnzMKzNrTab = Split(sMKzNr, Chr(254))
    fAnzMKzTab = Split(sMkz, Chr(254))
    Dim strConnectionString As String
    strConnectionString = "Provider=Custom"
    
    Dim arResources As New CalendarResources
    Dim pRes0 As New CalendarResource
    Dim pRes1 As CalendarResource
    
    pRes0.SetDataProvider2 strConnectionString, True
      
    If pRes0.DataProvider Is Nothing Then
        Debug.Assert False
        Exit Sub
    End If
    
    If Not pRes0.DataProvider.Open Then
        If Not pRes0.DataProvider.create Then
            Debug.Assert False
            Exit Sub
        End If
    End If
    
    '// ** schedules
    Dim pSchedules As CalendarSchedules
    Set pSchedules = pRes0.DataProvider.Schedules
    
    If pSchedules Is Nothing Then
        Exit Sub
    End If
    
    If pSchedules.Count < 1 Then
        For li = 0 To UBound(fAnzMKzNrTab)
            pSchedules.AddNewSchedule fAnzMKzTab(li)
        Next li
        pRes0.DataProvider.Save
    End If
    
    '// ** resources
    
    pRes0.Name = pSchedules.Item(0).Name
    pRes0.ScheduleIDs.Add pSchedules.Item(0).id
    arResources.Add pRes0
    For li = 1 To UBound(fAnzMKzNrTab)
        Set pRes1 = New CalendarResource
        pRes1.SetDataProvider pRes0.DataProvider, False
        pRes1.Name = fAnzMKzTab(li)
        pRes1.ScheduleIDs.Add pSchedules.Item(li).id
        arResources.Add pRes1
        Set pRes1 = Nothing
    Next li
    
      
        
    CalendarControl.SetMultipleResources arResources


'-------------------------------------------------------------------------------------
'* This routine is used to clone Events and point to the right schedule
'-------------------------------------------------------------------------------------

Private Sub fsBKZPruef(ByRef sEvents As XtremeCalendarControl.CalendarEvents, ByRef sEvent As CalendarEvent)
    On Error Resume Next
    Dim lBkzNrTab() As String
    Dim li As Integer
    Dim lID As Integer
    Dim lEvent As CalendarEvent
    Dim lInhalt As String
    
    lInhalt = sEvent.CustomProperties("BKZ_ZUWEISUNG")
    If lInhalt = "" Then
        Exit Sub
    End If
    lBkzNrTab = Split(lInhalt, vbCrLf)
    For li% = 0 To UBound(lBkzNrTab) - 1
        lID = fForm.mtGetMkzId(Val(lBkzNrTab(li)))
        If lID > 0 Then
            Set lEvent = sEvent.CloneEvent
            lEvent.ScheduleID = lID
            sEvents.Add lEvent
            Set lEvent = Nothing
        End If
    Next li
En



Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2012 at 9:15am
Your issue was answered, did it work for you?
Back to Top
mri0202 View Drop Down
Newbie
Newbie


Joined: 07 October 2009
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote mri0202 Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2012 at 9:17am
I found a solution myself
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.