Beispiel #1
0
 protected override NWidget CreateExampleContent()
 {
     m_Calendar = new NCalendar();
     m_Calendar.HorizontalPlacement  = ENHorizontalPlacement.Left;
     m_Calendar.VerticalPlacement    = ENVerticalPlacement.Top;
     m_Calendar.SelectedDateChanged += new Function <NValueChangeEventArgs>(OnCalendarSelectedDateChanged);
     return(m_Calendar);
 }
Beispiel #2
0
        /// <summary>
        /// Creates a dummy callendar for the Calendar section.
        /// </summary>
        /// <returns></returns>
        private NCalendar CreateCalendar()
        {
            NCalendar calendar = new NCalendar();

            calendar.Margins         = new NMargins(10);
            calendar.BorderThickness = new NMargins(0);
            return(calendar);
        }
Beispiel #3
0
        public List <NCalendar> GetVisitCalendar(string dateStart, string dateEnd)
        {
            List <NCalendar> retval = new List <NCalendar>();
            DateTime?        dStart = null;
            DateTime?        dEnd   = null;

            if (!string.IsNullOrEmpty(dateStart))
            {
                dStart = Convert.ToDateTime(dateStart);
            }
            if (!string.IsNullOrEmpty(dateEnd))
            {
                dEnd = Convert.ToDateTime(dateEnd).AddDays(1);
            }


            List <VW_Meeting> list = null;

            using (CEntities db = new CEntities())
            {
                int      UId = Convert.ToInt32(Session["UserID"]);
                DateTime ds  = Convert.ToDateTime(dateStart);
                DateTime de  = Convert.ToDateTime(dateEnd);
                list = db.VW_Meeting.Where(a => a.UserId == UId && a.DateStart >= ds && a.DateEnd <= de).ToList();
                foreach (var item in list)
                {
                    NCalendar tmp = new NCalendar();
                    tmp.id       = item.Id;
                    tmp.title    = item.CustomerName;
                    tmp.start    = item.DateStart.ToString("yyyy-MM-dd HH:mm");
                    tmp.end      = item.DateEnd.ToString("yyyy-MM-dd HH:mm");
                    tmp.editable = true;
                    if (item.MeetingDoneId == 1)
                    {
                        tmp.color = "#FFB752";//TURUNCU
                    }
                    else if (item.MeetingDoneId == 2)
                    {
                        tmp.color = "#87B87F";//YEŞİL
                    }
                    else
                    {
                        tmp.color = "#B74635";//KIRMIZI
                    }
                    retval.Add(tmp);
                }
            }
            return(retval);
        }