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)); }
internal static List <ActivityDisplayObject> GetAllActivitiesWithDataByAgendaID(int?eID) { List <ActivityDisplayObject> retval = new List <ActivityDisplayObject>(); if (eID != null) { using (var db = new RFIDDBEntities()) { try { List <Activity> aList = db.Activities.Where(o => o.AgendaID == eID).ToList(); foreach (var item in aList) { ActivityDisplayObject toAdd = new ActivityDisplayObject(); toAdd.Activity = item; toAdd.Agenda = db.Agendas.Where(o => o.ID == item.AgendaID).FirstOrDefault(); toAdd.ActivityDetail = db.ActivityDetails.Where(o => o.ActivityID == item.ID).FirstOrDefault(); retval.Add(toAdd); } } catch { } } } return(retval); }
public IHttpActionResult GetActivityByID(int filter) { ActivityDisplayObject retVal = new ActivityDisplayObject(); if (filter > 0) { retVal.Activity = db.Activities.Where(o => o.ID == filter).FirstOrDefault(); retVal.ActivityDetail = db.ActivityDetails.Where(o => o.ActivityID == filter).FirstOrDefault(); retVal.ActivityType = db.ActivityTypes.Where(o => o.ID == retVal.Activity.ActivityTypeID).FirstOrDefault(); int accessEventID = int.Parse(ConfigurationManager.AppSettings["ActiveEvent"]); retVal.CheckedInCount = ATAPS_Pile.GetActivityAttendeeCurrentCountByActivityID(retVal.Activity.ID, retVal.Activity.AgendaID); } return(Ok(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)); }
public IHttpActionResult GetActivitiesByAgendaID(int filter) { List <ActivityDisplayObject> retVal = new List <ActivityDisplayObject>(); List <Activity> aList = db.Activities.Where(o => o.AgendaID == filter).ToList(); foreach (Activity act in aList) { ActivityDisplayObject toAdd = new ActivityDisplayObject(); toAdd.Activity = act; toAdd.ActivityDetail = db.ActivityDetails.Where(o => o.ActivityID == act.ID).FirstOrDefault(); toAdd.Agenda = db.Agendas.Where(o => o.ID == filter).FirstOrDefault(); toAdd.ActivityType = db.ActivityTypes.Where(o => o.ID == toAdd.Activity.ActivityTypeID).FirstOrDefault(); retVal.Add(toAdd); } return(Ok(retVal)); }