Multiresource Calendar in Progress (solved) |
Post Reply |
Author | |
WolfStone
Newbie Joined: 03 July 2006 Location: Austria Status: Offline Points: 7 |
Post Options
Thanks(0)
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----------------------------------
|
|
WolfStone
Newbie Joined: 03 July 2006 Location: Austria Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Solved:
I have to use 2 Dataprovider.
chCalendarcontrol:Dataprovider for normal Schedules
and
chResource0:Dataprovider for Mutischedules
regards
Wolfgang
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |