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----------------------------------
|