Example #1
0
        protected void SetCalendar()
        {
            SiteData site = SiteData.CurrentSite;

            DateTime dtStart = Calendar1.CalendarDate.AddDays(1 - Calendar1.CalendarDate.Day).Date;
            DateTime dtEnd   = dtStart.AddMonths(1).Date;

            dtStart = site.ConvertSiteTimeToUTC(dtStart);
            dtEnd   = site.ConvertSiteTimeToUTC(dtEnd);

            using (CalendarDataContext db = CalendarDataContext.GetDataContext()) {
                List <vw_carrot_CalendarEvent> lst = (from c in db.vw_carrot_CalendarEvents
                                                      where c.EventDate >= dtStart &&
                                                      c.EventDate < dtEnd &&
                                                      c.SiteID == SiteID
                                                      orderby c.EventDate, c.EventStartTime
                                                      select c).ToList();

                lst.ForEach(x => x.EventDate = site.ConvertUTCToSiteTime(x.EventDate));

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

                Calendar1.HilightDateList = dates;

                CalendarHelper.BindDataBoundControl(dgEvents, lst);
            }
        }
        protected void LoadData()
        {
            if (!IsPostBack)
            {
                var lst2 = CalendarHelper.GetYears(SiteID);
                CalendarHelper.BindDataBoundControl(ddlFilter, lst2);
                ddlFilter.SelectedValue = "-2";
            }

            var lst = CalendarHelper.GetProfileView(SiteID, int.Parse(ddlFilter.SelectedValue));

            CalendarHelper.BindDataBoundControl(dgEvents, lst);
        }
Example #3
0
        protected void SetCalendar()
        {
            SiteData site = SiteData.CurrentSite;

            DateTime dtStart = Calendar1.CalendarDate.AddDays(1 - Calendar1.CalendarDate.Day).Date;
            DateTime dtEnd   = dtStart.AddMonths(1).Date;

            dtStart = site.ConvertSiteTimeToUTC(dtStart);
            dtEnd   = site.ConvertSiteTimeToUTC(dtEnd);

            List <vw_carrot_CalendarEvent> lst = null;

            using (CalendarDataContext db = CalendarDataContext.GetDataContext()) {
                lst = (from c in db.vw_carrot_CalendarEvents
                       where c.EventDate >= dtStart &&
                       c.EventDate < dtEnd &&
                       c.SiteID == SiteID &&
                       c.IsPublic == true &&
                       (!c.IsCancelledEvent || c.IsCancelledPublic) &&
                       (!c.IsCancelledSeries || c.IsCancelledPublic)
                       orderby c.EventDate ascending, c.EventStartTime ascending, c.IsCancelledEvent ascending
                       select c).ToList();
            }

            lst.ForEach(x => x.EventDate = site.ConvertUTCToSiteTime(x.EventDate));

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

            List <Guid> cats = (from dd in lst select dd.CalendarEventCategoryID).Distinct().ToList();

            Calendar1.HilightDateList = dates;

            CalendarHelper.BindDataBoundControl(dgEvents, lst);

            SetDDLSelections();

            CalendarHelper.BindRepeater(rpCat, CalendarHelper.GetCalendarCategories(SiteID).Where(x => cats.Contains(x.CalendarEventCategoryID)));
        }
        protected void LoadData()
        {
            var lst = CalendarHelper.GetCalendarCategories(SiteID);

            CalendarHelper.BindDataBoundControl(dgMenu, lst);
        }