Beispiel #1
0
    protected void DayPilotScheduler1_TimeRangeSelected(object sender, DayPilot.Web.Ui.Events.TimeRangeSelectedEventArgs e)
    {
        #region Simulation of database update

        DataRow dr = table.NewRow();
        dr["start"]  = e.Start;
        dr["end"]    = e.End;
        dr["id"]     = Guid.NewGuid().ToString();
        dr["name"]   = "New event";
        dr["column"] = e.Resource;

        table.Rows.Add(dr);
        table.AcceptChanges();
        #endregion

        setDataSourceAndBind();
        DayPilotScheduler1.Update(String.Format("New event created."));
    }
    protected void DayPilotScheduler1_TimeRangeSelected(object sender, DayPilot.Web.Ui.Events.TimeRangeSelectedEventArgs e)
    {
        #region Simulation of database update

        if (e.Multirange != null)
        {
            foreach (TimeRangeSelectedEventArgs me in e.Multirange)
            {
                CreateEvent(me.Start, me.End, me.Resource);
            }
        }
        else
        {
            CreateEvent(e.Start, e.End, e.Resource);
        }

        #endregion

        setDataSourceAndBind();
        DayPilotScheduler1.UpdateWithMessage("New event created.");
    }