Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - DoRetrieveDayEvents - How to know about Resouce
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DoRetrieveDayEvents - How to know about Resouce

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


Joined: 25 April 2008
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote pritpal Quote  Post ReplyReply Direct Link To This Post Topic: DoRetrieveDayEvents - How to know about Resouce
    Posted: 27 April 2008 at 9:52pm

Hello Everybody

First timer on board. Just 14 days old in XtreamCalendar space.
 
I am populating calendar with a single "custom" DataProvider with multiple resources, as
//----------------------------------------------------------------------//
CLASS V32Calendar
..
..
ENDCLASS
//----------------------------------------------------------------------//
METHOD AddSchedules() CLASS V32Calendar
   Local i
   // aSchedules := { { 'SUPER', 1 }, { 'MIDDLE', 2 } }
 
   for i := 1 to len( ::aSchedules )
      ::oResources:Add( CreateResource( self, ::aSchedules[ i,1 ], ::aSchedules[ i,2 ] ) )
   next
   ::oCal:SetMultipleResources( ::oResources )
   RETURN nil
//----------------------------------------------------------------------//
Static Function CreateResource( oV32Cal, cName, nScheduleID )
   Local oResource := CreateObject( oV32Cal:ClsResource )
   WITH OBJECT oResource
      :Name := cName
      :ScheduleIDs:Add( nScheduleID )
      :SetDataProvider2( "Provider=custom", .f. )
      //:DataProvider:CacheMode := xtpCalendarDPCacheModeOff
      :DataProvider:Create()
   END
   Return oResource
//----------------------------------------------------------------------//
METHOD OnDoRetrieveEvents( dtDay, oEvents )
   //  Here I populate the events based on my own tables
   // 
   Return NIL
//----------------------------------------------------------------------//
 
Everything goes well. Calendar is populted properly. The problem is performance issue. As DoRetrieveDayEvents is fired for every resource for a single day, I have no clue how to filter database for events which belong to schedules contained in that resource. I have to pull all events to that day and set ScheduleID member.
 
This is double work on database engine. Not double, but as many times as many resources are set for the calendar.
 
Anybody with any idea how to determine to which resource oEvents belongs to?
 
Regards 
Pritpal Bedi
a student of software analysis & design
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.297 seconds.