protected void DayPilotScheduler1_Command(object sender, CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "refresh":
            LoadResources();
            LoadSeparators();
            DayPilotScheduler1.DataSource = new DataManager().GetAssignments(DayPilotScheduler1);
            DayPilotScheduler1.DataBind();
            if (e.Data != null && e.Data["message"] != null)
            {
                DayPilotScheduler1.UpdateWithMessage((string)e.Data["message"]);
            }
            else
            {
                DayPilotScheduler1.UpdateWithMessage("Updated.");
            }

            break;

        case "clear":
            DayPilotScheduler1.ClientState.Clear();
            LoadResources();
            LoadSeparators();
            DayPilotScheduler1.DataSource = new DataManager().GetAssignments(DayPilotScheduler1);
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.UpdateWithMessage("Filter cleared.");
            break;
        }
    }
Пример #2
0
    protected void DayPilotCalendar1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "previous":
            DayPilotCalendar1.StartDate = DayPilotCalendar1.StartDate.AddDays(-DayPilotCalendar1.Days);
            break;

        case "next":
            DayPilotCalendar1.StartDate = DayPilotCalendar1.StartDate.AddDays(DayPilotCalendar1.Days);
            break;

        case "today":
            DayPilotCalendar1.StartDate = (DayPilotCalendar1.Days == 7) ? DayPilot.Utils.Week.FirstDayOfWeek(DateTime.Today) : DateTime.Today;
            break;

        case "week":
            DayPilotCalendar1.Days      = 7;
            DayPilotCalendar1.StartDate = DayPilot.Utils.Week.FirstDayOfWeek(DayPilotCalendar1.StartDate);
            break;

        case "day":
            DayPilotCalendar1.Days = 1;
            break;
        }

        DayPilotCalendar1.DataBind();
        DayPilotCalendar1.Update(CallBackUpdateType.Full);
    }
Пример #3
0
    protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "next":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            DayPilotScheduler1.ScrollY   = 20;
            break;

        case "previous":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(-1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            break;

        case "this":
            DayPilotScheduler1.StartDate = new DateTime(DateTime.Today.Year, 1, 1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            break;

        case "refresh":
        case "filter":
            // refresh is always done, see setDataSourceAndBind()
            break;

        default:
            throw new Exception("Unknown command.");
        }

        setDataSourceAndBind();
        DayPilotScheduler1.Update();
    }
Пример #4
0
    protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "next":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddMonths(2);
            DayPilotScheduler1.Days      = DateTime.DaysInMonth(DayPilotScheduler1.StartDate.Year, DayPilotScheduler1.StartDate.Month) + DateTime.DaysInMonth(DayPilotScheduler1.StartDate.AddMonths(1).Year, DayPilotScheduler1.StartDate.AddMonths(1).Month);
            break;

        case "previous":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddMonths(-2);
            DayPilotScheduler1.Days      = DateTime.DaysInMonth(DayPilotScheduler1.StartDate.Year, DayPilotScheduler1.StartDate.Month) + DateTime.DaysInMonth(DayPilotScheduler1.StartDate.AddMonths(1).Year, DayPilotScheduler1.StartDate.AddMonths(1).Month);
            break;

        case "this":
            DayPilotScheduler1.StartDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
            DayPilotScheduler1.Days      = DateTime.DaysInMonth(DayPilotScheduler1.StartDate.Year, DayPilotScheduler1.StartDate.Month) + DateTime.DaysInMonth(DayPilotScheduler1.StartDate.AddMonths(1).Year, DayPilotScheduler1.StartDate.AddMonths(1).Month);
            break;

        case "refresh":
        case "filter":
            //string filter = (string)e.Data;
            //DayPilotScheduler1.DataSource = getData(DayPilotScheduler1.StartDate, DayPilotScheduler1.EndDate.AddDays(1), filter);
            setDataSourceAndBind();
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.Update(CallBackUpdateType.EventsOnly);
            return;     // note that the binding done inside the case section here

        default:
            throw new Exception("Unknown command.");
        }

        setDataSourceAndBind();
        DayPilotScheduler1.Update(CallBackUpdateType.Full);
    }
Пример #5
0
 protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
 {
     switch (e.Command)
     {
     case "refresh":
         setDataSourceAndBind();
         DayPilotScheduler1.Update();
         break;
     }
 }
Пример #6
0
 protected void DayPilotCalendar1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
 {
     switch (e.Command)
     {
     case "refresh":
         UpdateScheduler();
         LoadResources();
         this.dplsGantt.Update(CallBackUpdateType.Full);
         break;
     }
 }
Пример #7
0
 protected void DayPilotCalendar1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
 {
     switch (e.Command)
     {
     case "navigate":
         DateTime start = (DateTime)e.Data["start"];
         DayPilotCalendar1.StartDate  = start;
         DayPilotCalendar1.DataSource = dbGetEvents(DayPilotCalendar1.StartDate, DayPilotCalendar1.Days);
         DayPilotCalendar1.DataBind();
         DayPilotCalendar1.Update(DayPilot.Web.Ui.Enums.CallBackUpdateType.Full);
         break;
     }
 }
Пример #8
0
    protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "refresh":
            LoadResourcesAndEvents();
            break;

        case "filter":
            LoadResourcesAndEvents();
            break;
        }
    }
Пример #9
0
    protected void DayPilotCalendar1_OnCommand(object sender, CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "navigate":
            DayPilotCalendar1.StartDate = (DateTime)e.Data["day"];
            LoadCalendarData();
            break;

        case "refresh":
            LoadCalendarData();
            break;
        }
    }
Пример #10
0
    protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "next":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            DayPilotScheduler1.ScrollY   = 20;
            break;

        case "previous":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(-1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            break;

        case "this":
            DayPilotScheduler1.StartDate = new DateTime(DateTime.Today.Year, 1, 1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            break;

        case "delete":
            string id = (string)e.Data["id"];
            #region Simulation of database update
            DataRow dr = table.Rows.Find(id);

            if (dr != null)
            {
                table.Rows.Remove(dr);
                table.AcceptChanges();
            }
            #endregion

            break;

        case "test":
            JsonData d = e.Data;
            break;

        case "refresh":
        case "filter":
            // refresh is always done, see setDataSourceAndBind()
            break;

        default:
            throw new Exception("Unknown command.");
        }

        setDataSourceAndBind();
        DayPilotScheduler1.Update();
    }
Пример #11
0
    protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "next":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            DayPilotScheduler1.ScrollY   = 20;
            break;

        case "previous":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(-1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            break;

        case "this":
            DayPilotScheduler1.StartDate = new DateTime(DateTime.Today.Year, 1, 1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            break;

        case "test":
            JsonData d = e.Data;
            break;

        case "selected":
            if (DayPilotScheduler1.SelectedEvents.Count > 0)
            {
                EventInfo ei = DayPilotScheduler1.SelectedEvents[0];
                DayPilotScheduler1.SelectedEvents.RemoveAt(0);
                //DayPilotScheduler1.DataBind();
                DayPilotScheduler1.UpdateWithMessage("Event removed from selection: " + ei.Text);
            }

            break;

        case "refresh":
            // refresh is always done, see setDataSourceAndBind()
            break;

        case "filter":
            // refresh is always done, see setDataSourceAndBind()
            break;

        default:
            throw new Exception("Unknown command.");
        }

        setDataSourceAndBind();
        DayPilotScheduler1.Update();
    }
Пример #12
0
    protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "navigate":
            DayPilotScheduler1.StartDate = (DateTime)e.Data["day"];
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.Update();
            break;

        case "refresh":
            setDataSourceAndBind();
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.Update();

            setDataSourceAndBind();
            DayPilotScheduler2.DataBind();
            DayPilotScheduler2.Update();

            break;

        case "previous":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddDays(-1);
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.Update();

            DayPilotScheduler2.StartDate = DayPilotScheduler2.StartDate.AddDays(-1);
            DayPilotScheduler2.DataBind();
            DayPilotScheduler2.Update();
            setDataSourceAndBind();
            break;

        case "next":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddDays(1);
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.Update();

            DayPilotScheduler2.StartDate = DayPilotScheduler2.StartDate.AddDays(1);
            DayPilotScheduler2.DataBind();
            DayPilotScheduler2.Update();
            setDataSourceAndBind();
            break;
        }
        setDataSourceAndBind();
        DayPilotScheduler1.DataBind();
        DayPilotScheduler1.Update();
        DayPilotScheduler2.DataBind();
        DayPilotScheduler2.Update();
    }
Пример #13
0
 protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
 {
     switch (e.Command)
     {
     case "deletechildren":
         foreach (Resource resource in DayPilotScheduler1.Resources)
         {
             resource.Children.Clear();
             //resource.Children.Add("test", "test1");
             //resource.DynamicChildren = true;
             //resource.DynamicChildren = true;
             //resource.Expanded = true;
         }
         DayPilotScheduler1.Update(CallBackUpdateType.Full);
         break;
     }
 }
Пример #14
0
    protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "refresh":
            setDataSourceAndBind();
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.UpdateWithMessage("Events refreshed automatically");
            break;

        default:
            throw new Exception("Unknown command.");
        }

        setDataSourceAndBind();
        DayPilotScheduler1.Update(CallBackUpdateType.Full);
    }
Пример #15
0
        protected void DayPilotCalendarWeek_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
        {
            switch (e.Command)
            {
            case "navigate":
                DayPilotCalendarWeek.StartDate  = (DateTime)e.Data["day"];
                DayPilotCalendarWeek.DataSource = GetData(DayPilotCalendarWeek.StartDate, DayPilotCalendarWeek.EndDate.AddDays(1));
                DayPilotCalendarWeek.DataBind();
                DayPilotCalendarWeek.Update();
                break;

            case "refresh":
                DayPilotCalendarWeek.DataSource = GetData(DayPilotCalendarWeek.StartDate, DayPilotCalendarWeek.EndDate.AddDays(1));
                DayPilotCalendarWeek.DataBind();
                DayPilotCalendarWeek.Update();
                break;
            }
        }
Пример #16
0
        protected void DayPilotMonth1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
        {
            switch (e.Command)
            {
            case "navigate":
                DayPilotMonth1.StartDate  = (DateTime)e.Data["day"];
                DayPilotMonth1.DataSource = GetData(DayPilotMonth1.VisibleStart, DayPilotMonth1.VisibleEnd);
                DayPilotMonth1.DataBind();
                DayPilotMonth1.Update();
                break;

            case "refresh":
                DayPilotMonth1.DataSource = GetData(DayPilotMonth1.VisibleStart, DayPilotMonth1.VisibleEnd);
                DayPilotMonth1.DataBind();
                DayPilotMonth1.Update();
                break;
            }
        }
Пример #17
0
    protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "refresh":
            DayPilotScheduler1.DataSource = dbGetEvents(DayPilotScheduler1.StartDate, DayPilotScheduler1.Days);
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.Update();
            break;

        case "filter":
            LoadResources();
            DayPilotScheduler1.DataSource = dbGetEvents(DayPilotScheduler1.StartDate, DayPilotScheduler1.Days);
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.Update();
            break;
        }
    }
Пример #18
0
    protected void DayPilotScheduler1_OnCommand(object sender, CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "navigate":
            DayPilotScheduler1.StartDate = (DateTime)e.Data["start"];
            DayPilotScheduler1.Days      = (int)e.Data["days"];
            DayPilotScheduler1.ScrollX   = 0;
            LoadTimeline();
            LoadDoctors();
            LoadAppointments();
            break;

        case "refresh":
            LoadTimeline();
            LoadDoctors();
            LoadAppointments();
            break;
        }
    }
Пример #19
0
 protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
 {
 }
Пример #20
0
 protected void DayPilotCalendar1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
 {
 }
 protected void DayPilotCalendar1_OnCommand(object sender, CommandEventArgs e)
 {
 }
Пример #22
0
    protected void DayPilotScheduler1_Command(object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
    {
        switch (e.Command)
        {
        case "next":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            DayPilotScheduler1.ScrollX   = 0;
            adjustCellLayout();
            break;

        case "previous":
            DayPilotScheduler1.StartDate = DayPilotScheduler1.StartDate.AddYears(-1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            DayPilotScheduler1.ScrollX   = 0;
            adjustCellLayout();
            break;

        case "this":
            DayPilotScheduler1.StartDate = new DateTime(DateTime.Today.Year, 1, 1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            DayPilotScheduler1.ScrollX   = 0;
            adjustCellLayout();
            break;

        case "year":
            int year = (int)e.Data;
            DayPilotScheduler1.StartDate = new DateTime(year, 1, 1);
            DayPilotScheduler1.Days      = Year.Days(DayPilotScheduler1.StartDate.Year);
            DayPilotScheduler1.ScrollX   = 0;
            adjustCellLayout();
            break;

        case "goto":
            DayPilotScheduler1.StartDate = (DateTime)e.Data["start"];
            DayPilotScheduler1.Days      = (int)e.Data["days"];
            DayPilotScheduler1.ScrollX   = 0;
            if (IsTodayInRange())
            {
                DayPilotScheduler1.SetScrollX(DateTime.Today);
            }
            else
            {
                DayPilotScheduler1.ScrollX = 0;
            }
            adjustCellLayout();
            break;

        case "refresh":
            // just rebind
            break;

        case "filter":
            //string filter = (string)e.Data;
            //DayPilotScheduler1.DataSource = getData(DayPilotScheduler1.StartDate, DayPilotScheduler1.EndDate.AddDays(1), filter);
            setDataSourceAndBind();
            DayPilotScheduler1.DataBind();
            DayPilotScheduler1.Update(CallBackUpdateType.EventsOnly);
            return;     // note that the binding done inside the case section here

        default:
            throw new Exception("Unknown command.");
        }

        setDataSourceAndBind();
        DayPilotScheduler1.Update();
    }