public static List<ParticipantBlock> GetParticipants(SessionBlock session) { List<ParticipantBlock> sessionParticipants = new List<ParticipantBlock>(); int sessionID = (session as IContent).ContentLink.ID; var eventParticipants = AttendRegistrationEngine.GetParticipants(session.EventPageBase); foreach (ParticipantBlock participant in eventParticipants) { if (participant.Sessions != null && participant.Sessions.Items != null && participant.Sessions.Items.Count > 0) if ((from s in participant.Sessions.Items where s.ContentLink.ID == sessionID select s.ContentLink.ID).Any<int>()) sessionParticipants.Add(participant); } return sessionParticipants; }
public static Session GenerateSession(SessionBlock currentSession, string groupName, string groupID, bool nextSessionIsConcurrent, bool previousSessionIsConcurrent) { Session newSession = new Session(); newSession.CurrentSessionBlock = currentSession; newSession.Name = (currentSession as IContent).Name; newSession.Enabled = currentSession.NumberOfSeats == 0 || (currentSession.NumberOfSeats - GetParticipants(currentSession).Count) > 0; newSession.Selected = currentSession.Mandatory; newSession.NewGroup = !previousSessionIsConcurrent; if (!previousSessionIsConcurrent) { if (string.IsNullOrEmpty(groupName)) { newSession.Header = currentSession.Start.ToString("HH:mm"); } else { newSession.Header = groupName; } } newSession.Group = groupID; if (currentSession.IntroContent != null) newSession.IntroContent = currentSession.IntroContent.ToHtmlString(); newSession.CheckBox = !nextSessionIsConcurrent && !previousSessionIsConcurrent && !currentSession.Mandatory; newSession.ContentID = (currentSession as IContent).ContentLink.ID; return newSession; }