In my server side classes, I need to get an appointment, modify it, and save it back to the database.
I have the ActivityID (key), I stored it in my database when I created the activity.
But I don't see any method on the web schedule data provider or web schedule info object. I see "Add" and "Remove" and "Update" Activity methods, but where is GetActivity??????????????????????????
Here is the workaround I am trying, don't know if it works yet... There is a method GetAppointmentsForDate(resource, date) so I get that collection of activities and then loop through them to find the one I need.
And I never got an answer aobut populating a resource object, so the resource I am passing in is created by saying
Resource R = new Resource();
R.Name = 'resourcename'
I hope that is good enough.
What am I missing
Hi Francis thanks for all yor help resolving this issue. Here is the solution I finally made work:
My challenge was I have a "game" (baseball game etc) object and an appointment object managed by webschedule, the appointment can be modified through your UI controls of course, but also we have game edit screens where the user can update some properties of the game that need to be reflected in the appointment (date, location, etc).
So when I create the game, I create an activity using WebScheduleSqlClientProvider.AddActivity, and I store the ID of that Activity in my GAME table.
When the user makes changes to the properties that are actually stored on the activity (that is, my GAME table does not store start date - it refers to ACTIVITY) I need to update that activity from my business logic layer.
I never figured out why my VisibleResources collection was unpopulated. But I believe this was making the call to GetResourceFromName fail.
Long story short I was unable to properly prepare the parameters to call UpdateActivity. i think the API needs a little refinement to support managing resources, activities etc. I think it has been optimized maye for creating my own DataProvider there were some interesting protected methods that probably would have made my life much easier had I been creating my own DataProvider class.
So, I simply wrapped your stored procedure "Activity_upd" into my Data Access Layer, and I call that from my Business Logic layer on update of the game object.
I understand you need to get the Resource object from the Resource Name so you can call the WebScheduleInfo's GetActivitiesForDate method.
The WebScheduleInfo class has a VisibleResources property which itself has a GetResourcefromName method. I think this might be part of the solution you need.
Here is an example line of code invoking the call:
Resource resource = this.WebScheduleInfo1.VisibleResources.GetResourceFromName("Resource name");
I hope this helps.
Frank,
On second look at your question, I think the "Locate an Activity" document addresses how to get the Activity from the WebScheduleInfo object. Evidently, you do need to loop through the Activities collection and retur the Appointment based on your lookup criteria.
The URL is here:http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.2/CLR3.5/html/WebSchedule_Locate_an_Activity.html
Does this provide what you need in this situation? Please let me know how it goes.
Thanks,Francis
Frank, your case in now in my queue. We do have some documentation on getting, adding updating and removing activities in code, but the updating section is only given for the client side. I will check into this and get back to you in the support case.
Online help index link for the above topics:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.2/CLR3.5/html/WebSchedule_Activities.html
I still need some help here. I have opened a case.