Print Page | Close Window

Please help Event

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=9798
Printed Date: 07 October 2024 at 11:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Please help Event
Posted By: malban
Subject: Please help Event
Date Posted: 05 March 2008 at 5:17am
When I created by evenements nothing is displayed on the calendar.
my code in vb6 :
 
Dim StrSujet  As String
  Dim StartTime As Date, EndTime As Date
  Dim lngTmpIdSoin As Long
 
  Dim RR As ADODB.Recordset
  Dim RE As ADODB.Recordset
  Dim RC As New ADODB.Recordset
 
  Dim calEvent As CalendarEvent
 
  Set RE = New ADODB.Recordset
  Set RC = New ADODB.Recordset
  Set RR = New ADODB.Recordset
 
  strSQL = "SELECT * FROM AGENDA WHERE IdSite = " & lngNSite & "  AND Supprimer = 0"
  RE.Open strSQL, ObjConnect.ADOConnectionObject, adOpenStatic
 
  Do While Not RE.EOF
    StartTime = RE.Fields("DateHeureRVD").Value
    EndTime = RE.Fields("DateHeureRVF").Value
    StrSujet = vbNullString
   
    Set calEvent = g_DataResourcesMan.DataProvider(0).CreateEventEx(RE.Fields("IdAgenda").Value)
    'Set calEvent = Me.CalendarControl.DataProvider.CreateEventEx(RE.Fields("IdAgenda").Value)
    calEvent.StartTime = StartTime
    calEvent.EndTime = EndTime
   
    strSQL = "SELECT * FROM CLIENT WHERE IdClient =  " & RE.Fields("IdClient").Value & " AND IdSite = " & lngNSite
    RC.Open strSQL, ObjConnect.ADOConnectionObject, adOpenStatic
    If Not RC.EOF Then
      strSQL = "SELECT * FROM CIVILITE WHERE IdCivilite = " & RC.Fields("IdCivilite").Value
      RR.Open strSQL, ObjConnect.ADOConnectionObject, adOpenStatic
      If Not RR.EOF Then
        StrSujet = StrSujet & RR.Fields("Libelle").Value & Space$(1) & RC.Fields("Nom").Value & " " & RC.Fields("Prenom").Value
      Else
        StrSujet = StrSujet & RC.Fields("Nom").Value & " " & RC.Fields("Prenom").Value
      End If
      RR.Close
    Else
      StrSujet = "Aucun Client"
    End If
    RC.Close
    StrSujet = StrSujet & Space$(1) & FormatDateTime(StartTime, vbShortTime) & " - " & FormatDateTime(EndTime, vbShortTime)
    calEvent.Subject = StrSujet
    calEvent.ScheduleID = RE.Fields("IdLieu").Value
    calEvent.CustomProperties("IdAgenda") = RE.Fields("IdAgenda").Value
    calEvent.CustomProperties("IdLieu") = RE.Fields("IdLieu").Value
    calEvent.BusyStatus = xtpCalendarBusyStatusBusy
   
    'Afficher les soins Agendas
    If RetrieveEnv("AFFICHER_SOIN_AGENDA", , True) <> "0" And RetrieveEnv("AFFICHER_SOIN_AGENDA", , True) <> vbNullString Then
      If RE.Fields("IdSoin").Value > 0 Then
        If RE.Fields("IdSousSoin").Value > 0 Then
          lngTmpIdSoin = RE.Fields("IdSousSoin").Value
        Else
          lngTmpIdSoin = RE.Fields("IdSoin").Value
        End If
        strSQL = "SELECT * FROM ARTICLE WHERE IdArticle = " & lngTmpIdSoin
        RR.Open strSQL, ObjConnect.ADOConnectionObject, adOpenStatic
        If Not RR.EOF Then
          calEvent.Location = "Soins : " & RR.Fields("Libelle").Value & IIf(RR.Fields("Duree_Abonnement").Value > 0, " (" & RR.Fields("Duree_Abonnement").Value & " min.)", vbNullString)
        Else
          calEvent.Location = "Soins : " & "Aucun"
        End If
        RR.Close
    
      Else
        calEvent.Location = "Soins : " & "Aucun"
      End If
    End If
   
    'Afficher les Estheticienne Agendas
    strSQL = "SELECT * FROM VACATAIRE WHERE IdVacataire = " & RE.Fields("IdOperateur").Value
    RR.Open strSQL, ObjConnect.ADOConnectionObject, adOpenStatic
    If Not RR.EOF Then
      calEvent.Body = "Esthéticien(ne) : " & RR.Fields("Nom").Value & Space$(1) & RR.Fields("Prenom").Value
    Else
      calEvent.Body = "Esthéticien(ne) : Aucun"
    End If
    RR.Close
    g_DataResourcesMan.DataProvider(0).AddEvent calEvent
    'Me.CalendarControl.DataProvider.AddEvent calEvent
    CalendarControl.Populate
    CalendarControl.RedrawControl
   
    RE.MoveNext
  Loop
  RE.Close
 
Thanks



Replies:
Posted By: wlcabral
Date Posted: 05 March 2008 at 5:57am

**** Basically I use this steps (MS FOXPRO) :

with xtremecalendar

.dataprovider.Create()

.dataprovider.labellist.initdefaultvalues()

.dataprovider.removeallevents()

.populate()

Do while NOT EOF()

oevent = .dataprovider.createevent()

with oevent

.starttime = starttime

.endtime = endtime

.subject = Alltrim(subject)

.body = body

.Label = Label

.busystatus = busystatus

.importance = importance

.privateflag = Private

.meetingflag = meeting

.customproperties.property('ukey') = myID

endwith

.dataprovider.addevent( oevent )

ENDDO

.populate()

endwith



-------------
wlcabral


Posted By: malban
Date Posted: 05 March 2008 at 6:12am
I make this but nothing is displayed on the calendar


Posted By: wlcabral
Date Posted: 05 March 2008 at 6:25am

did you create dataprovider ?  dataprovider.create()



-------------
wlcabral


Posted By: malban
Date Posted: 05 March 2008 at 6:27am
yes
 
Public Sub OpenProvider(ByVal eDataProviderType As CodeJockCalendarDataType, ByVal strConnectionString As String)
    Set m_pCustomDataHandler = Nothing
   
    ' SQL Server provider
    If eDataProviderType = cjCalendarData_SQLServer Then
        Set m_pCustomDataHandler = New providerSQLServer
        '' Create DSN "Calendar_SQLServer" to connect to SQL Server Calendar DB
        m_pCustomDataHandler.OpenDB strConnectionString
        m_pCustomDataHandler.SetCalendar CalendarControl
    End If
               
    CalendarControl.SetDataProvider strConnectionString
   
    If eDataProviderType = cjCalendarData_SQLServer Then
        CalendarControl.DataProvider.CacheMode = xtpCalendarDPCacheModeOnRepeat
    End If
    CalendarControl.DataProvider.Create
    If Not CalendarControl.DataProvider.Open Then
        CalendarControl.DataProvider.Create
    End If
   
    m_eActiveDataProvider = eDataProviderType
       
    CalendarControl.Populate
    DatePicker.RedrawControl
End Sub


Posted By: wlcabral
Date Posted: 05 March 2008 at 7:38am
I prefer work directly with the "memory", so I just need to use DataProvider.Create().  Give a try...
 
I don't know if this information is in your strConnectionString, but I read in help that :
"For all custom data provider the mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20SuitePro%20ActiveX%20v11.2.2\Help\SymbolReference.chm::/XtremeCalendarControl~CalendarDataProvider~ConnectionString.html - ConnectionString  must contain "Provider=custom".  "
 


-------------
wlcabral


Posted By: malban
Date Posted: 05 March 2008 at 8:08am
it is ok but of that I put an schuldes, event is not displayed



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