![]() |
Multiple Schedules & Resources |
Post Reply ![]() |
Author | |
djldc ![]() Newbie ![]() Joined: 08 January 2010 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() Posted: 28 January 2010 at 3:16pm |
I am trying to translate the code I have found on the message boards and I am having a very hard time. Would someone be able to tell me in english (followed by a snippet of sample code) how I would set up my calendar with multiple schedules. So far, it sounds like I need to create a dataprovider for each schedule, get the schedules, and then add the schedules to the resources. Am I on the right track? Thank you,
fyi, I am translating over to AlphaSoftware code (xbasic). Don |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
Here is something I threw together for another user trying to convert to a different language:
OK, I'll try to put this to an analogy to better understand. A College has a calendar. Now this school has asked Codejock to help them keep track of their Professors schedules, ClassRooms, and what Course will occur in each room for any given day. There are different ways to approach this, but I'll try to show you 2 different ways. First we have our College Calendar. In this calendar we can display multiple resources\schedules. This calendar will display at least 2 columns of data per day. The data first column(s) will be professor schedules, the second\last column will be ClassRoom Activities. For this setup lets say we have 10 professors and 5 classrooms (small college). Here we will give each professor his own calendar. With this setup we want to actually see each Professor's schedule in a column for any given day. To do this he must have his own RESOURCE. Inside this RESOURCE you can add his SCHEDULE. Now the last column for a day will be used to display the current schedule for the rooms in the College. Here I'll show how to add multiple schedules to a single resource. We ONLY want to see ONE column for ALL rooms for any given day. With this setup we can use the Pre_Polulate event to filter un-wanted rooms. To do this we add a single RESOURCE. Inside this RESOURCE you can add a SCHEDULE for EACH room. Let's put this to use. Below is a fully functional example for VB6. Note I could have used a loop to add the Professor's resources, but I did them separate to make sure you can see what is happening. Professor's Dr. Tom Dr. Bob Dr. Oleg Dr. Mark Dr. Mike Dr. Tony Dr. Green Dr. Brown Dr. Black Dr. Smith Rooms: MSB 101 MSB 102 MSB 103 MSB 104 MSB 105 'Add this to global variables section ![]() |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
FYI, in PowerBuilder, the "default" property for an object is not referenced the same as in VB6, for example:
PowerBuilder: // 'Add Dr. Oleg's resource to the data provider pRCDesc = OleCalendarResourceManager.Resource(2) pRCDesc.Resource.SetDataProvider(pData, False) pRCDesc.Resource.ScheduleIDs.Add(pSchedules.Item(2).Id) pRCDesc.GenerateName = True VB6 'Add Dr. Oleg's resource to the data provider |
|
![]() |
|
djldc ![]() Newbie ![]() Joined: 08 January 2010 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
Great example! Thank you. Now I just need to figure out how to translate some of this into AlphaSoftware language.
|
|
![]() |
|
djldc ![]() Newbie ![]() Joined: 08 January 2010 Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
OK.. got it working. Now I am trying to get the schedule ID of the resource/column I click on. That is, when I click to create an event I would like to get the id of the schedule I clicked on. Is that possible? Thank you.
Don |
|
![]() |
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 |