Print Page | Close Window

Multiresource Calendar in Progress (solved)

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=11613
Printed Date: 27 September 2024 at 3:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Multiresource Calendar in Progress (solved)
Posted By: WolfStone
Subject: Multiresource Calendar in Progress (solved)
Date 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----------------------------------



Replies:
Posted By: WolfStone
Date 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



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