public ActionResult AgendaCheckins(int id) { // when viewing a specific agenda, show the Activities (if any) and the total Attendees for the Agenda AgendaDisplayObject retVal = DBHelper.GetAgendaWithDataByID(id); retVal.ActivityFullList = new List <ActivityDisplayObject>(); foreach (Activity act in retVal.ActivityList) { ActivityDisplayObject toAdd = new ActivityDisplayObject(); toAdd.Activity = act; toAdd.CurrentCheckins = ATAPS_Pile.GetActivityAttendeeCurrentByActivityID(act.ID, id); if (toAdd.CurrentCheckins == null) { toAdd.CurrentCheckins = new List <AttendeeLastCheck>(); toAdd.CheckedInCount = 0; } else { toAdd.CheckedInCount = toAdd.CurrentCheckins.Count(); } retVal.ActivityFullList.Add(toAdd); } return(View(retVal)); }
public ActionResult ActivityDetails(int filter, int id) { ViewBag.FilterID = filter; ActivityDisplayObject retVal = new ActivityDisplayObject(); retVal.Activity = db.Activities.Where(o => o.ID == id).FirstOrDefault(); retVal.CurrentCheckins = ATAPS_Pile.GetActivityAttendeeCurrentByActivityID(id, retVal.Activity.AgendaID); retVal.AttendeeList = new List <Attendee>(); foreach (AttendeeLastCheck check in retVal.CurrentCheckins) { retVal.AttendeeList.Add(db.Attendees.Where(o => o.ID == check.AttendeeID).FirstOrDefault()); } retVal.CheckedInCount = retVal.CurrentCheckins.Count(); return(View(retVal)); }