Home Unanswered Active Tags New Question

modify isThereEvent method

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

Asked by Anonymous 4 years ago.
Replies
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 Dan Letecky 4 years ago.
Thank you Dan!
Comment posted by Anonymous 4 years ago.

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

Comment posted by Arjay 2 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 anon 2 years ago.

Please post and example script

Comment posted by Anonymous 1 year ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java