private void ResetParticipants() { try { EZDiscuss.UserControls.ucMemberProfile ucMP = new UserControls.ucMemberProfile(); Classes.Member mem = new Classes.Member(); for (int i = 1; i <= 20; i++) { mem.firstName = null; switch (i) { case 1: ucMP = ucMP1; break; case 2: ucMP = ucMP2; break; case 3: ucMP = ucMP3; break; case 4: ucMP = ucMP4; break; case 5: ucMP = ucMP5; break; case 6: ucMP = ucMP6; break; case 7: ucMP = ucMP7; break; case 8: ucMP = ucMP8; break; case 9: ucMP = ucMP9; break; case 10: ucMP = ucMP10; break; case 11: ucMP = ucMP11; break; case 12: ucMP = ucMP12; break; case 13: ucMP = ucMP13; break; case 14: ucMP = ucMP14; break; case 15: ucMP = ucMP15; break; case 16: ucMP = ucMP16; break; case 17: ucMP = ucMP17; break; case 18: ucMP = ucMP18; break; case 19: ucMP = ucMP19; break; case 20: ucMP = ucMP20; break; default: break; } ucMP.Initialize(); } } catch (Exception ex) { if (Session["memberId"] != null) { EZDiscuss.Classes.Helper.LogError("DiscussionBoard.aspx", "ResetParticipants", ex.Message, (long)Session["memberId"]); } else { EZDiscuss.Classes.Helper.LogError("DiscussionBoard.aspx", "ResetParticipants", ex.Message, 0); } } }
private void LoadParticipants(long topicId) { try { // Display all the Participants for the specified Topic Classes.Topic topic = new Classes.Topic(); DataTable dt = topic.TopicMembersRetrieve(topicId); if (dt.Rows.Count > 0) { Session["Participants"] = dt; int i = 1; EZDiscuss.UserControls.ucMemberProfile ucMP = new UserControls.ucMemberProfile(); ResetParticipants(); foreach (DataRow dr in dt.Rows) { if (i <= 20) { Classes.Member member = new Classes.Member(); member.firstName = dr["FirstName"].ToString(); member.memberId = Convert.ToInt64(dr["MemberId"]); member.gender = Convert.ToInt32(dr["Gender"]); member.photo = dr["Photo"].ToString(); switch (i) { case 1: ucMP = ucMP1; break; case 2: ucMP = ucMP2; break; case 3: ucMP = ucMP3; break; case 4: ucMP = ucMP4; break; case 5: ucMP = ucMP5; break; case 6: ucMP = ucMP6; break; case 7: ucMP = ucMP7; break; case 8: ucMP = ucMP8; break; case 9: ucMP = ucMP9; break; case 10: ucMP = ucMP10; break; case 11: ucMP = ucMP11; break; case 12: ucMP = ucMP12; break; case 13: ucMP = ucMP13; break; case 14: ucMP = ucMP14; break; case 15: ucMP = ucMP15; break; case 16: ucMP = ucMP16; break; case 17: ucMP = ucMP17; break; case 18: ucMP = ucMP18; break; case 19: ucMP = ucMP19; break; case 20: ucMP = ucMP20; break; default: break; } ucMP.Photo = member.photo; ucMP.FirstName = member.firstName; ucMP.MemberId = member.memberId; ucMP.Gender = member.gender; ucMP.TopicId = topicId; ucMP.ActivateControl(true); i++; } } } else { // Reset Member Profile Controls ResetParticipants(); }; } catch (Exception ex) { if (Session["memberId"] != null) { EZDiscuss.Classes.Helper.LogError("DiscussionBoard.aspx", "LoadParticipants", ex.Message, (long)Session["memberId"]); } else { EZDiscuss.Classes.Helper.LogError("DiscussionBoard.aspx", "LoadParticipants", ex.Message, 0); } } }