Пример #1
0
        public JsonResult Events()
        {
            var json = new List <dynamic>();

            using (var srv = new EventSrv())
            {
                var past   = srv.PastEvents().Take(5);
                var coming = srv.GetUpcoming();
                var events = coming.Concat(past);
                foreach (var e in events)
                {
                    json.Add(new
                    {
                        id    = e.EventId,
                        title = e.EventName,
                        text  = e.Description,
                        date  = e.FromDate
                    });
                }
                return(Json(json, JsonRequestBehavior.AllowGet));
            }
        }
Пример #2
0
        public PartialViewResult Upcoming()
        {
            var model = _srv.GetUpcoming();

            return(PartialView(model));
        }