Exemple #1
0
        protected void SetCalendar()
        {
            using (dbCalendarDataContext db = dbCalendarDataContext.GetDataContext()) {
                var lst = (from c in db.tblCalendars
                           where c.EventDate == theEventDate &&
                           c.IsActive == true &&
                           c.SiteID == this.SiteID
                           orderby c.EventDate
                           select c).ToList();

                rEvents.DataSource = lst;
                rEvents.DataBind();
            }
        }
        protected void SetCalendar()
        {
            DateTime dtStart = DateTime.Now.Date.AddDays(this.DaysInPast);
            DateTime dtEnd   = DateTime.Now.Date.AddDays(this.DaysInFuture);

            using (dbCalendarDataContext db = dbCalendarDataContext.GetDataContext()) {
                var lst = (from c in db.tblCalendars
                           where c.EventDate >= dtStart &&
                           c.EventDate < dtEnd &&
                           c.IsActive == true &&
                           c.SiteID == this.SiteID
                           orderby c.EventDate
                           select c).ToList();

                dgEvents.DataSource = lst;
                dgEvents.DataBind();
            }
        }
Exemple #3
0
        protected void SetCalendar()
        {
            DateTime dtStart = Calendar1.CalendarDate.AddDays(1 - Calendar1.CalendarDate.Day);
            DateTime dtEnd   = dtStart.AddMonths(1);

            using (dbCalendarDataContext db = dbCalendarDataContext.GetDataContext()) {
                var lst = (from c in db.tblCalendars
                           where c.EventDate >= dtStart &&
                           c.EventDate < dtEnd &&
                           c.IsActive == true &&
                           c.SiteID == this.SiteID
                           orderby c.EventDate
                           select c).ToList();

                List <DateTime> dates = (from dd in lst
                                         select Convert.ToDateTime(dd.EventDate).Date).Distinct().ToList();

                Calendar1.HilightDateList = dates;

                dgEvents.DataSource = lst;
                dgEvents.DataBind();
            }
        }