Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // get all future agendaitems
            if (!IsPostBack)
            {
                IEnumerable <Node> nodes = AgendaHelper.GetUpcomingEvents(-1);

                this.rptAgenda.DataSource = nodes;
                this.rptAgenda.DataBind();
            }
        }
        protected string GetNextEvent(int nodeId)
        {
            string             result      = String.Empty;
            IEnumerable <Node> agendaItems = AgendaHelper.GetUpcomingEvents(nodeId);

            if (agendaItems.Any())
            {
                Node nextEvent = agendaItems.FirstOrDefault(n => Convert.ToDateTime(n.GetProperty("date").Value).Date >= DateTime.Now.Date);
                result = String.Format("Volgende event op: {0}", nextEvent != null ? Convert.ToDateTime(nextEvent.GetProperty("date").Value).ToString("dd-MM-yyyy") : "Geen komende events");
            }
            else
            {
                result = "Volgende event op: -";
            }

            return(result);
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // set showAll link based on macro parameter
            btnShowAll.Visible = !ShowAll;

            // get all agenda items of current node

            IEnumerable <Node> agendaItems = AgendaHelper.GetUpcomingEvents(Node.GetCurrent().Id);

            if (ShowAll == false)
            {
                agendaItems = agendaItems.Take(3).ToList();
            }

            this.rptAgenda.DataSource = agendaItems;
            this.rptAgenda.DataBind();

            SetAllAgendaItemsButton();
        }