This example illustrates how to define different time intervals that are available for scheduling. This information is stored in the ~\App_Data\ResourcesAvailabilities.mdb database. It has the ResourcesAvailabilities table with the following schema:
Id: Integer,
ResourceId: String,
StartTime: DateTime,
EndTime: DateTime
So, generally, each resource can have independent availability intervals. This information is loaded and exposed via the ResourcesAvailabilities class.
First of all, we use this information to modify the default appearance of the Time Cells by handling the ASPxScheduler.HtmlTimeCellPrepared Event. Then, we disallow appointment creation and modification actions if their execution is initiated outside available intervals. For this, we substitute the regular MenuViewCallbackCommand with a custom one (see Callback Commands), and handle the ASPxScheduler.AppointmentChanging Event. Note that we use a technique from the How to show user friendly message from the server on a callback ticket to show a warning if the end-user tries to schedule an appointment in the restricted area. In other words, we handle the ASPxScheduler.CustomJSProperties Event on the server side to pass a warning message on the client side. This message is intercepted in the ASPxClientScheduler.EndCallback Event.
Here is a screenshot that illustrates a sample application in action:
See Also:
End-User Restrictions - How to allow appointment creation or deletion only for specific users
End-User Restrictions - How to allow appointment modification or deletion depending on custom field values
End-User Restrictions - How to implement a client-side confirmation on deleting an appointment
Example Comments
Added By: Kriss at: 8/15/2013 8:33:08 AM
Can you please convert this example to work with SQL Server too(reading the resources), it will be nice to have it?
Thanks
Kriss