Пример #1
0
 protected void DayPilotScheduler1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.Scheduler.BeforeEventRenderEventArgs e)
 {
     if (e.Id == "11")
     {
         e.ContextMenuClientName = "cmSpecial";
         e.EventMoveEnabled      = false;
         e.EventResizeEnabled    = false;
         e.EventClickEnabled     = false;
         e.DurationBarColor      = "red";
         e.BackgroundColor       = "lightyellow";
     }
 }
Пример #2
0
    protected void DayPilotScheduler1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.Scheduler.BeforeEventRenderEventArgs e)
    {
        int id = 0;

        int.TryParse(e.Id, out id);

        if (id % 2 == 0)
        {
            e.DurationBarColor         = "#a81010";
            e.DurationBarBackColor     = "#e89d9d";
            e.EventMoveVerticalEnabled = false;
        }
        else
        {
            e.EventMoveHorizontalEnabled = false;
        }
    }
Пример #3
0
 protected void DayPilotScheduler1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.Scheduler.BeforeEventRenderEventArgs e)
 {
 }
Пример #4
0
    protected void DayPilotScheduler1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.Scheduler.BeforeEventRenderEventArgs e)
    {
        e.InnerHTML = String.Format("{0} ({1:d} - {2:d})", e.Text, e.Start, e.End);
        int status = Convert.ToInt32(e.Tag["ReservationStatus"]);

        switch (status)
        {
        case 0:                                      // new
            if (e.Start < DateTime.Today.AddDays(2)) // must be confirmed two day in advance
            {
                e.DurationBarColor = "red";
                e.ToolTip          = "Expired (not confirmed in time)";
            }
            else
            {
                e.DurationBarColor = "orange";
                e.ToolTip          = "New";
            }
            break;

        case 1:                                                                                               // confirmed
            if (e.Start < DateTime.Today || (e.Start == DateTime.Today && DateTime.Now.TimeOfDay.Hours > 18)) // must arrive before 6 pm
            {
                e.DurationBarColor = "#f41616";                                                               // red
                e.ToolTip          = "Late arrival";
            }
            else
            {
                e.DurationBarColor = "green";
                e.ToolTip          = "Confirmed";
            }
            break;

        case 2:                                                                                           // arrived
            if (e.End < DateTime.Today || (e.End == DateTime.Today && DateTime.Now.TimeOfDay.Hours > 11)) // must checkout before 10 am
            {
                e.DurationBarColor = "#f41616";                                                           // red
                e.ToolTip          = "Late checkout";
            }
            else
            {
                e.DurationBarColor = "#1691f4";      // blue
                e.ToolTip          = "Arrived";
            }
            break;

        case 3:     // checked out
            e.DurationBarColor = "gray";
            e.ToolTip          = "Checked out";
            break;

        default:
            throw new ArgumentException("Unexpected status.");
        }

        e.InnerHTML = e.InnerHTML + String.Format("<br /><span style='color:gray'>{0}</span>", e.ToolTip);

        int    paid      = 0; // Convert.ToInt32(e.DataItem["ReservationPaid"]);
        string paidColor = "#aaaaaa";

        //e.Areas.Add(new Area().Bottom(10).Right(4).Html("<div style='color:" + paidColor + "; font-size: 8pt;'>Paid: " + paid + "%</div>").Visibility(AreaVisibility.Visible));
        //e.Areas.Add(new Area().Left(4).Bottom(8).Right(4).Height(2).Html("<div style='background-color:" + paidColor + "; height: 100%; width:" + paid + "%'></div>").Visibility(AreaVisibility.Visible));
    }
Пример #5
0
 protected void DayPilotCalendar1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.Scheduler.BeforeEventRenderEventArgs e)
 {
     e.InnerHTML = Server.HtmlEncode(e.Text);
     // e.EventMoveVerticalEnabled = false;
     e.StaticBubbleHTML = String.Format("<b>{0}</b><br/>Start: {1}<br/>End: {2}", e.Text, e.Start, e.End);
 }