예제 #1
0
파일: Schedule.cs 프로젝트: thexur/1code
        internal void FillDropPanel(DataTable dt)
        {
            if (DateTimeFieldName == string.Empty)
            {
                throw new Exception("DateTimeFieldName can't be null, set the property DateTimeFieldName");
            }
            string startDate  = firstDayOfTargetDateTime.ToString("yyyy-M-d");
            string endDate    = firstDayOfTargetDateTime.AddDays(columnNum * rowNum - 1).ToString("yyyy-M-d");
            string sqlExpress = DateTimeFieldName + " >= '" + startDate + "' And " + DateTimeFieldName + " <= '" + endDate + "'";

            DataRow[]     filterData       = dt.Select(sqlExpress, DateTimeFieldName);
            List <string> highLightDayList = new List <string>();

            foreach (DataRow dr in filterData)
            {
                DateTime  date        = ((DateTime)dr[DateTimeFieldName]);
                string    id          = dr[KeyField].ToString();
                string    title       = dr[TitleFieldName].ToString();
                string    description = dr[DescriptionFieldName].ToString();
                DropPanel _dropPanel  = CalendarCellControlList[(date - firstDayOfTargetDateTime).Days].GenerateDropPanel(id, date, title, "");
                DropPanelClientIDCollection.Add(_dropPanel);
                string dateStr = date.ToString("yyyy-M-d");
                if (!highLightDayList.Contains(dateStr))
                {
                    highLightDayList.Add(dateStr);
                }
            }
            DateTimePicker.HighLightDayList     = highLightDayList;
            DateTimePicker.HighLightDayListType = "yyyy-M-d";
        }
예제 #2
0
        public virtual DropPanel GenerateDropPanel(string id, DateTime date, string title, string description)
        {
            DropPanel dropPanel = new DropPanel();

            dropPanel.ID             = "dropPanel" + id;
            dropPanel.FromContextKey = new { key = id, datetime = date.ToString("yyyy-M-d") };
            dropPanel.HeaderText     = title;
            dropPanel.ToolTip        = title;
            dropPanel.ContentText    = description;
            Content.Controls.Add(dropPanel);
            return(dropPanel);
        }
예제 #3
0
 public virtual DropPanel GenerateDropPanel(string id, DateTime date,string title, string description)
 {
     DropPanel dropPanel = new DropPanel();
     dropPanel.ID = "dropPanel"+id;
     dropPanel.FromContextKey = new { key = id, datetime = date.ToString("yyyy-M-d") };
     dropPanel.HeaderText = title;
     dropPanel.ToolTip = title;
     dropPanel.ContentText = description;
     Content.Controls.Add(dropPanel);
     return dropPanel;
 }