protected void Page_Load(object sender, EventArgs e) { rptMemberCards = (MemberCardList)Page.LoadControl("~/Presentation/Sublayouts/Common/MemberCardList.ascx"); rptMemberCards.ID = "rptMemberCards"; memberList.Controls.Add(rptMemberCards); List<MemberCardModel> memberCardSrc = TelligentService.GetModerators(); rptMemberCards.DataSource = memberCardSrc; rptMemberCards.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { rptMemberCards = (MemberCardList)Page.LoadControl("~/Presentation/Sublayouts/Common/MemberCardList.ascx"); rptMemberCards.ID = "rptMemberCards"; memberList.Controls.Add(rptMemberCards); //TODO: To replace with actual data for production MembershipManagerProxy mem = new MembershipManagerProxy(); List<Member> members = new List<Member>() { mem.GetMember(Guid.Empty) }; ////////////////////////////////////////////////////////// List<MemberCardModel> memberCardSrc = members.Select(m => Members.MemberCardModelFactory(m)).ToList<MemberCardModel>(); Session["members_parents"] = memberCardSrc; rptMemberCards.DataSource = memberCardSrc.Take(25).ToList<MemberCardModel>(); rptMemberCards.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { rptMemberCards = (MemberCardList)Page.LoadControl("~/Presentation/Sublayouts/Common/MemberCardList.ascx"); rptMemberCards.ID = "rptMemberCards"; memberList.Controls.Add(rptMemberCards); if (!IsPostBack) { Item currItem = Sitecore.Context.Item; Item[] items = null; ResultCount = 16; //Child Issue Drop List Sitecore.Data.Fields.MultilistField childIssues = currItem.Fields["Child Issues"]; if (childIssues != null) { items = childIssues.GetItems(); foreach (var item in items) { ddlChildIssues.Items.Add(new ListItem() { Text = item.Name, Value = item.ID.ToString() }); } ddlChildIssues.DataBind(); } //Topic Drop List Sitecore.Data.Fields.MultilistField topics = currItem.Fields["Topics"]; if (topics != null) { items = topics.GetItems(); foreach (var item in items) { ddlTopics.Items.Add(new ListItem() { Text = item.Name, Value = item.ID.ToString() }); } ddlTopics.DataBind(); } memberChkbx.Attributes.Add("value", Constants.TelligentRoles.RegisteredUser.ToString()); expertChkbx.Attributes.Add("value", Constants.TelligentRoles.Expert.ToString()); moderatorChkbx.Attributes.Add("value", Constants.TelligentRoles.Moderator.ToString()); MembershipManager mem = new MembershipManager(); //Get all members List<Member> members = mem.GetMembers().Where(m => !String.IsNullOrEmpty(m.ScreenName)).ToList<Member>(); if (CurrentMember != null) { if (!String.IsNullOrEmpty(CurrentMember.ScreenName)) { //All members except current logged in user members = mem.GetMembers().Where(m => !String.IsNullOrEmpty(m.ScreenName)).Where(m => m.ScreenName.Trim() != CurrentMember.ScreenName.Trim()).ToList<Member>(); } } Session["members"] = members; //List<Member> members = new List<Member>(); //members.Add(member1); //Session["members"] = members; //TODO: To replace with actual data for production //MembershipManagerProxy mem = new MembershipManagerProxy(); //List<Member> members = new List<Member>() { mem.GetMember(Guid.Empty) }; ////////////////////////////////////////////////////////// List<MemberCardModel> memberCardSrc = members.Select(m => Members.MemberCardModelFactory(m)).ToList<MemberCardModel>(); Session["members_parents"] = memberCardSrc; rptMemberCards.DataSource = memberCardSrc.Take(ResultCount).ToList<MemberCardModel>(); rptMemberCards.DataBind(); } }