示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _CalendarAbsPath = MapPath("~/Calendars");

        if (!IsPostBack)
        {
            // Load our list of available calendars
            CalendarList.DataSource = LoadCalendarList();
            CalendarList.DataBind();

            // Select all calendars in the list by default
            foreach (ListItem li in CalendarList.Items)
            {
                li.Selected = true;
            }
        }

        // Get a list of todays events and upcoming events
        List <Occurrence> todaysEvents   = GetTodaysEvents();
        List <Occurrence> upcomingEvents = GetUpcomingEvents();

        // Bind our list to the repeater that will display the events.
        TodaysEvents.DataSource = todaysEvents;
        TodaysEvents.DataBind();

        // Bind our list to the repeater that will display the events.
        UpcomingEvents.DataSource = upcomingEvents;
        UpcomingEvents.DataBind();
    }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var dataAdapter = new WebsiteEventDataAdapter(new Adxstudio.Xrm.Cms.PortalContextDataAdapterDependencies(Portal));
            var now         = DateTime.UtcNow;

            var future = Html.TimeSpanSetting("Events/DisplayTimeSpan/Future").GetValueOrDefault(TimeSpan.FromDays(90));

            UpcomingEvents.DataSource = dataAdapter.SelectEventOccurrences(now, now.Add(future)).Take(Html.IntegerSetting("Home Event Count").GetValueOrDefault(3));
            UpcomingEvents.DataBind();
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs args)
        {
            var dataAdapter = new ConferenceEventDataAdapter(new PortalContextDataAdapterDependencies(Portal, PortalName), PortalConference);

            var occurrences = dataAdapter.SelectEventOccurrences(
                PortalConference.GetAttributeValue <DateTime?>("adx_startingdate").GetValueOrDefault(DateTime.MinValue),
                PortalConference.GetAttributeValue <DateTime?>("adx_enddate").GetValueOrDefault(DateTime.MaxValue)).ToArray();

            UpcomingEvents.DataSource = occurrences
                                        .OrderBy(e => e.Start);

            UpcomingEvents.DataBind();
        }
        protected void Page_Load(object sender, EventArgs args)
        {
            var dataAdapter = new WebsiteEventDataAdapter(new PortalContextDataAdapterDependencies(Portal, PortalName));
            var now         = DateTime.UtcNow;

            var past   = Html.TimeSpanSetting("Events/DisplayTimeSpan/Past").GetValueOrDefault(TimeSpan.FromDays(90));
            var future = Html.TimeSpanSetting("Events/DisplayTimeSpan/Future").GetValueOrDefault(TimeSpan.FromDays(90));

            var occurrences = dataAdapter.SelectEventOccurrences(now.Subtract(past), now.Add(future)).ToArray();

            UpcomingEvents.DataSource = occurrences.Where(e => e.Start >= now).OrderBy(e => e.Start);
            UpcomingEvents.DataBind();

            PastEvents.DataSource = occurrences.Where(e => e.Start < now).OrderByDescending(e => e.Start);
            PastEvents.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                HtmlLink link = Page.Master.FindControl("layoutStyleSheet") as HtmlLink;
                link.Href = "css/secondary.css";
            }
            myDAL     objmyDAl = new myDAL();
            DataTable DT       = new DataTable();
            int       found;

            found = objmyDAl.Upcoming_DAL(ref DT);
            if (found == 1)
            {
                UpcomingEvents.DataSource = DT;
                UpcomingEvents.DataBind();
            }
        }
示例#6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _CalendarAbsPath = MapPath("~/Calendars");

        if (!IsPostBack)
        {
            // Load our list of available calendars
            CalendarList.DataSource = LoadCalendarList();
            CalendarList.DataBind();

            // Select all calendars in the list by default
            foreach (ListItem li in CalendarList.Items)
            {
                li.Selected = true;
            }
        }

        // Create an object that will sort our events by date
        EventDateSorter eventDateSorter = new EventDateSorter();

        // Build a list of today's events
        List <Event> todaysEvents = new List <Event>(GetTodaysEvents());

        // Sort our list by start date
        todaysEvents.Sort(eventDateSorter);

        // Bind our list to the repeater that will display the events.
        TodaysEvents.DataSource = todaysEvents;
        TodaysEvents.DataBind();

        // Build a list of upcoming events
        List <Event> upcomingEvents = new List <Event>(GetUpcomingEvents());

        // Sort that list by start date
        upcomingEvents.Sort(eventDateSorter);

        // Bind our list to the repeater that will display the events.
        UpcomingEvents.DataSource = upcomingEvents;
        UpcomingEvents.DataBind();
    }