public virtual ParticipantCollection CheckParticipant(HttpContext context) { JsonSerializer serializer = new JsonSerializer(); StreamReader reader = new StreamReader(context.Request.InputStream); ParticipantCollection rv = new ParticipantCollection(); using (JsonTextReader streamReader = new JsonTextReader(reader)) { JArray @params = serializer.Deserialize(streamReader) as JArray; foreach (JObject jParti in @params) { Participant participant = jParti.ToObject <Participant>(serializer); if (participant.IsValid) { if (participant.ParticipantType != ParticipantType.Custom) { participant.Express = participant.GenExpress(); } } using (BPMConnection cn = new BPMConnection()) { cn.WebOpen(); participant.RuntimeDisplayString = participant.GetDisplayString(cn); } rv.Add(participant); } } return(rv); }
/// <summary> /// Creates a new <see cref="ClassroomModel"/> as a member of the given <see cref="ProtocolModel"/>, /// with the given Human Name. /// </summary> public ClassroomModel(ProtocolModel protocol, string humanName, ClassroomModelType classroomModelType) { this.m_Protocol = protocol; this.m_ClassroomModelType = classroomModelType; this.m_Participants = new ParticipantCollection(this, "Participants"); this.m_Presentations = new PresentationCollection(this, "Presentations"); this.m_HumanName = humanName; this.m_Connected = false; this.m_RtpEndPoint = null; }
/// <summary> /// Creates a new <see cref="ClassroomModel"/> as a member of the given <see cref="ProtocolModel"/>, /// with the given Human Name. /// </summary> public ClassroomModel(ProtocolModel protocol, string humanName, ClassroomModelType classroomModelType) { this.m_Protocol = protocol; this.m_ClassroomModelType = classroomModelType; this.m_Participants = new ParticipantCollection(this, "Participants"); this.m_Presentations = new PresentationCollection(this, "Presentations"); this.m_HumanName = humanName; this.m_Connected = false; this.m_RtpEndPoint = null; }
public PresentationModel(Guid id, ParticipantModel owner, string humanName, bool isUntitledPresentation) { this.m_Id = id; this.m_DeckTraversals = new DeckTraversalCollection(this, "DeckTraversals"); this.m_Participants = new ParticipantCollection(this, "Participants"); this.m_Owner = owner; this.m_HumanName = humanName; this.m_QuickPoll = null; this.m_IsUntitledPresentation = isUntitledPresentation; CurrentPresentation = this; }
public PresentationModel(Guid id, ParticipantModel owner, string humanName, bool isUntitledPresentation) { this.m_Id = id; this.m_DeckTraversals = new DeckTraversalCollection(this, "DeckTraversals"); this.m_Participants = new ParticipantCollection(this, "Participants"); this.m_Owner = owner; this.m_HumanName = humanName; this.m_QuickPoll = null; this.m_IsUntitledPresentation = isUntitledPresentation; CurrentPresentation = this; }
public String GetJSONParticipants() { //build json object to populate Participants view: //query Participants table to retrieve needed info List <Participant> participants = SqlFuDAL.FindObjectsByType <Participant>(); //perform any needed translation into JSON friendly object here: ParticipantCollection participantCol = new ParticipantCollection(); participantCol.Participants = participants.Where(p => p.IsActive).ToList(); String json = JsonConvert.SerializeObject(participantCol); JsonResult jsonData = new JsonResult { Data = JsonConvert.DeserializeObject(json) }; //return JSON object back to the view return(jsonData.Data.ToString()); }