API
Version 7.x > API > How do I retrieve Booking Events using the API? View modes: 
User avatar
Member
Member
robert.herrick-rdh2 - 11/17/2013 3:39:19 PM
   
How do I retrieve Booking Events using the API?
Hello, Kentico folks --

I am finding it really difficult to figure out just to get a DataSet of Booking Events from the database. I need it to create a custom Calendar control that is responsive to mobile browsers. Is there a Helper class that would allow me to get the Booking Events from a Path?

Thanks --
Robert Herrick

User avatar
Kentico Legend
Kentico Legend
Accepted solutionAccepted solution
Brenden Kehren - 11/21/2013 7:02:10 AM
   
RE:How do I retrieve Booking Events using the API?
Robert,

This should get you exactly what you need. You can use this for any document type, simply change the parameter.
CMS.DocumentEngine.TreeProvider provider = new CMS.DocumentEngine.TreeProvider();
DataSet eventDs = provider.SelectNodes(CMS.CMSHelper.CMSContext.CurrentSiteName, "/Your/Alias-Path/%", "", true, "cms.bookingevent", "EventDate >= '" + DateTime.Now.ToString() + "'");

User avatar
Member
Member
robert.herrick-rdh2 - 11/21/2013 7:12:04 AM
   
RE:How do I retrieve Booking Events using the API?
FroggEye --

That was exactly what I was looking for! Thank you for the help. I couldn't find something like that in the docs, but apparently I wasn't looking hard enough.

Thanks again --
Robert

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 11/22/2013 9:19:12 AM
   
RE:How do I retrieve Booking Events using the API?
Take a look at the API Examples as well, they have a lot of good information you might not find in the developer guide. By default I believe it is installed in /CMSAPIExamples in the root of your site and you can find it by going to Site Manager>Support>API Examples. If you don't see API Examples in the navigation, its not installed.