public JsonResult GetEventsForGantt(long id) { SubjectManager subjectmanager = new SubjectManager(); //ToDo replace getAll with get plant by id var subject = subjectmanager.Get(id); var events = new List <object>(); if (subject != null) { events.AddRange(GantHelper.GetAllEventsFromSubject(subject)); } return(Json(events.ToArray(), JsonRequestBehavior.AllowGet)); }
public JsonResult GetEventsForGantt() { SubjectManager subjectmanager = new SubjectManager(); var events = new List <object>(); foreach (var plant in subjectmanager.GetAll <Plant>().ToList().OrderBy(p => p.Name)) { if (plant != null) { events.AddRange(GantHelper.GetAllEventsFromSubject(plant)); } } return(Json(events.ToArray(), JsonRequestBehavior.AllowGet)); }