search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

modify isThereEvent method

Asked by Anonymous
16 years ago.

Hi

I need the daypilot to recognize all events in my database.

How can I modify the "isThereEvent" method to show that there is an event on all days specified in my database and not just today, tomorrow and anotherDay?

Thanks

Comment posted by Dan Letecky
16 years ago.
One of the possible approaches:

1. Write a stored procedure (plain SQL would be harder) that will return a table with two fields (day, exists).
  • The input parameters need to be the starting date, the number of days to be checked and maybe other conditions (filtering only selected resources, etc.).
  • The best way would probably to create a loop that runs SELECT command for each day to determine whether there is an event.
  • Output data source will contain two fields: day (date) and exists (bool).
2. Store the SP result in a DataTable (dt) with a PrimaryKey defined as "day" field.
3. In the isThereEvent method, check the DataRow returned by dt.Rows.Find(targetDateTime) for "exists" field.
Comment posted by Anonymous
16 years ago.
Thank you Dan!
Comment posted by Arjay
14 years ago.

Hi sir, I'm a newbie here. Can you please site some code examples to explain it further?.. thanks!

Comment posted by anon
14 years ago.

I've not used stored procedures, I don't know how to use datatables, could you please provide code examples like the post above has asked for??????????????????

Comment posted by Anonymous
13 years ago.

Please post and example script

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.