コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <CalEvent> events = new List <CalEvent>();
            CalEvent        ev     = new CalEvent();

            ev.start = DateTime.Parse("12/5/2015 8:00 PM");
            ev.end   = DateTime.Parse("12/5/2015 11:59 PM");
            ev.name  = "Shack Battle 1";
            ev.id    = "1";
            events.Add(ev);

            ev       = new CalEvent();
            ev.start = DateTime.Parse("12/17/2015 7:00 PM");
            ev.end   = DateTime.Parse("12/17/2015 11:00 PM");
            ev.name  = "Shack Battle 2";
            ev.id    = "2";
            events.Add(ev);


            DayPilotCalendar.DataSource     = events;
            DayPilotCalendar.DataStartField = "start";
            DayPilotCalendar.DataEndField   = "end";
            DayPilotCalendar.DataTextField  = "name";
            DayPilotCalendar.DataIdField    = "id";

            DayPilotCalendar.DataBind();
        }
コード例 #2
0
        protected void dlEmployee_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            //tblEmployee emp = (tblEmployee)e.Item.DataItem;
            DataRowView drv = (DataRowView)e.Item.DataItem;

            DayPilotCalendar dpc = (DayPilotCalendar)e.Item.FindControl("DayPilotCalendar1");

            if (ddlSearch.SelectedValue == "" || txtSearch.Text.Trim() == "")
            {
                //if (DateSelector1.DateValue != null)
                //    dpc.StartDate = (DateTime)DateSelector1.DateValue;
            }
            else
            {
                if (ddlSearch.SelectedValue == "ID" && txtSearch.Text.Trim() != "")
                {
                    long.TryParse(txtSearch.Text.Trim(), out BookID);
                    dpc.StartDate = rh.getReservationDateByID(BookID);
                }
                else if (ddlSearch.SelectedValue == "Mobile" && txtSearch.Text.Trim() != "")
                {
                    dpc.StartDate = rh.getReservationDateByMobile(txtSearch.Text.Trim());
                }
            }
            //get Business Exclude Hours
            dpc.BusinessExcludeHours = rh.getBusinessExcludeHours(drv["employeeNum"].ToString(), dpc.StartDate);
            //bind data
            dpc.DataSource = rh.getReservation(drv["employeeNum"].ToString(), dpc.StartDate, dpc.Days);
            dpc.DataBind();
        }