Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Multiresource Calendar in Progress (solved)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Multiresource Calendar in Progress (solved)

 Post Reply Post Reply
Author
Message
WolfStone View Drop Down
Newbie
Newbie
Avatar

Joined: 03 July 2006
Location: Austria
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote WolfStone Quote  Post ReplyReply Direct Link To This Post Topic: Multiresource Calendar in Progress (solved)
    Posted: 28 July 2008 at 8:47am
Hi @ all
 
I have a Problem with multiple Resources and Schedules in my Calendar-application. I uses progress OpenEdge 10.1b and ActivexSuite 10.3
 
I know that Progress is not your "normal" language but I think the calls are the same as in VB6.
 
Now I make a little Demo programm in Progress.
This Programm only displays 3 Recources (John, Jane, Test).
I use only 1 Dataprovider (memory)
(I create each event manually)
 
My Problem:
I could not see the event.
 
Whats wrong in my Code ?
 
Thx
 
Wolfgang
 
 
-------------------------------- BEGIN SOURCE ----------------------------------------
  DEFINE VARIABLE chCalendarControl AS COM-HANDLE NO-UNDO.
  DEFINE VARIABLE chDataProvider    AS COM-HANDLE NO-UNDO.
 
  DEFINE VARIABLE cResources AS CHARACTER INIT "John,Jain,Test"  NO-UNDO.
  DEFINE VARIABLE cConnectionString AS CHARACTER  NO-UNDO.
  DEFINE VARIABLE chEvent AS COM-HANDLE     NO-UNDO.
  DEFINE VARIABLE chSchedules AS COM-HANDLE      NO-UNDO.
  DEFINE VARIABLE chSchedule AS COM-HANDLE      NO-UNDO.
  DEFINE VARIABLE iInt AS INTEGER     NO-UNDO.
  DEFINE VARIABLE iScheduleId AS INTEGER     NO-UNDO.
  DEFINE VARIABLE chResources  AS COM-HANDLE   NO-UNDO.
  DEFINE VARIABLE chResource  AS COM-HANDLE   NO-UNDO.
 
  chCalendarControl = chCtrlFrame:CalendarControl.
 
  cConnectionString = "Provider=memory".
  chCalendarControl:SetDataProvider(cConnectionString).
 
  chDataProvider = chCalendarControl:DataProvider.
  /*If the Data Source can not be opened, then create a new data source*/
  IF NOT chDataProvider:OPEN() THEN
  DO:
    /* Create a new data source to use. */
    chDataProvider:CREATE().
  END.
  chCalendarControl:ViewType = 0.  
  chCalendarControl:DayView:ScrollToWorkDayBegin().
  chSchedules =  chDataProvider:Schedules.
  CREATE "Codejock.CalendarResources.10.3.1" chResources.
  iInt = 0.
  FahrzeugSchleife:
  DO iInt = 1 TO NUM-ENTRIES(cResources):
 
    /*Create an Schedule for each Resource*/
    chSchedules:AddNewSchedule (ENTRY(iInt,cResources)).
    CREATE "Codejock.CalendarResource.10.3.1" chResource.
    chResource:SetDataProvider(chDataProvider,FALSE).
    chResource:NAME = ENTRY(iInt,cResources).
   
    /*Schedule to Resource*/
    chSchedule = chSchedules:ITEM(iInt - 1).           
    iScheduleId = chSchedule:Id.                   
    chResource:ScheduleIDs:Add (iScheduleId).
    chResources:ADD(chResource).  /*Resource to Resources*/
  END.
 
  chCalendarControl:SetMultipleResources(chResources).
  chCalendarControl:Populate.    
  chCalendarControl:RedrawControl. 

  /**********************************/
  /*******  CREATE 1 Event **********/
  /**********************************/
  chEvent = chDataProvider:CreateEventEx(1).   /*EventId = 1*/
 
  chEvent:StartTime = toDateTime2 (TODAY, "1000").
  chEvent:EndTime = toDateTime2 (TODAY, "1630").
     
  chSchedules =  chDataProvider:Schedules.                                      
                                                                          
  ScheduleSchleife:
  DO iInt = 1 TO chSchedules:COUNT():
    chSchedule = chSchedules:ITEM(iInt - 1).
    IF chSchedule:NAME = "John" THEN
    DO:
      chEvent:ScheduleID = chSchedule:Id.
      LEAVE ScheduleSchleife.
    END.
  END.
  chEvent:AllDayEvent = FALSE.
  chEvent:Subject = "John's Event".
 
  chDataProvider:AddEvent(chEvent).
  /**********************************/
  chCalendarControl:Populate.    
  chCalendarControl:RedrawControl.  
 
-----------------------------END Source----------------------------------
Back to Top
WolfStone View Drop Down
Newbie
Newbie
Avatar

Joined: 03 July 2006
Location: Austria
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote WolfStone Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2008 at 12:32pm
Solved:
 
I have to use 2 Dataprovider.
 
chCalendarcontrol:Dataprovider for normal Schedules
and
chResource0:Dataprovider for Mutischedules
 
 
regards
Wolfgang
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.172 seconds.