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

Please help Event

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


Joined: 05 March 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote malban Quote  Post ReplyReply Direct Link To This Post Topic: Please help Event
    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
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
malban View Drop Down
Newbie
Newbie


Joined: 05 March 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote malban Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2008 at 6:12am
I make this but nothing is displayed on the calendar
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2008 at 6:25am

did you create dataprovider ?  dataprovider.create()

wlcabral
Back to Top
malban View Drop Down
Newbie
Newbie


Joined: 05 March 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote malban Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post 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 ConnectionString must contain "Provider=custom".  "
 
wlcabral
Back to Top
malban View Drop Down
Newbie
Newbie


Joined: 05 March 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote malban Quote  Post ReplyReply Direct Link To This Post Posted: 05 March 2008 at 8:08am
it is ok but of that I put an schuldes, event is not displayed
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.