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

Object Oriented Prgramming

Asked by Anonymous
12 years ago.

Hi,

I am trying to modify DemoSQL. I am using 3 tier achitecture.How can I use an object to insert the New Event into the database?

Thanks

Comment posted by Dan Letecky
12 years ago.
DayPilot doesn't impose any specific way of data update. The mechanism for creating a new event (from a context menu invoked on a time range selection) is the following:
protected void DayPilotCalendar1_TimeRangeMenuClick(object sender, 
TimeRangeMenuClickEventArgs e)
{
if (e.Command == "Insert")
{
// call your business layer code for inserting a new event
events.create(e.Start, e.End, "New event");

// set DataSource if you haven't specified DataSourceID in the .aspx
DayPilotCalendar1.DataSource = yourDataSource;

// bind the data
DayPilotCalendar1.DataBind();

// tell DayPilotCalendar to redraw the events on
// the client side (when using CallBack)
DayPilotCalendar1.Update();

}
}
This is a simplified example from Demo/Calendar/EventCreating.aspx.cs.
Comment posted by sp4ceman@gmail.com
11 years ago.

i have a layered approach and its going great, the only question i have is about the colouring.
i am binding the control to a colloction of Events.


these events areeach havean"EventType" (for example sickleave, birthday, bookings etc etc) , but they are all of type Event in the same collection.

is there a way to specify the colours for each type, maybe in the Event constructor, so that all birthdays appear in one colour and the leave appears in a different colour?

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