예제 #1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            //Check values selected in search
            //Check zipcode
            string zipcode = txtZipCode.Text;
            //Check child issue selected
            string issue = ddlChildIssues.SelectedValue.ToString();

            //Check Topic selected
            string topic = ddlTopics.SelectedValue.ToString();

            var role = new List <int>();

            //Check role types checked
            if (memberChkbx.Checked)
            {
                role.Add(Constants.TelligentRoles.RegisteredUser);
            }
            if (expertChkbx.Checked)
            {
                role.Add(Constants.TelligentRoles.Expert);
            }

            if (moderatorChkbx.Checked)
            {
                role.Add(Constants.TelligentRoles.Moderator);
            }

            //Perform search using criteria
            var test = FindMembers(zipcode, issue, topic, null);

            rptMemberCards.DataSource = test;
            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);


            List <MemberCardModel> memberCardSrc = TelligentService.GetModerators();

            rptMemberCards.DataSource = memberCardSrc;
            rptMemberCards.DataBind();
        }
예제 #3
0
        protected void ShowMore_ServerClick(object sender, EventArgs e)
        {
            List <MemberCardModel> m = rptMemberCards.DataSource as List <MemberCardModel>;

            if (m != null)
            {
                var mems = (List <MemberCardModel>)Session["members_parents"];

                if (mems != null)
                {
                    rptMemberCards.DataSource = mems;
                    rptMemberCards.DataBind();

                    showmore.Visible = false;
                }
            }
        }
예제 #4
0
        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();
        }
예제 #5
0
        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();
            }
        }