예제 #1
0
        private void Page_Load(object sender, EventArgs e)
        {
            var query   = Request.QueryString["q"];
            var groupId = Request.QueryString["g"];

            if (!groupId.IsNullOrEmpty())
            {
                GroupItem group          = Sitecore.Context.Database.GetItem(groupId);
                var       telligentGroup = TelligentService.ReadGroup(group.GroupID);
                if (telligentGroup != null)
                {
                    litMemberCount.Text     = telligentGroup["TotalMembers"].InnerText;
                    litDiscussionCount.Text = "5";
                }

                litGroupName.Text = group.Name;
                litGroupDesc.Text = group["Body Content"];

                if (!query.IsNullOrEmpty())
                {
                    if (!Request.QueryString["b"].Equals("true") || Request.QueryString["b"] == null)
                    {
                        dataSource             = TelligentService.GroupSearch(query, Constants.TelligentSearchParams.Group, groupId, group);
                        Session["groupSearch"] = dataSource;
                        rptResults.DataSource  = dataSource.Take(10).ToList();
                        rptResults.DataBind();

                        litSearchItem.Text    = query;
                        litResultCount.Text   = dataSource.Count.ToString();
                        panBoardTitle.Visible = true;
                    }
                    else
                    {
                        dataSource             = TelligentService.BoardSearch(query, Constants.TelligentSearchParams.Group, groupId, group);
                        Session["groupSearch"] = dataSource;
                        rptResults.DataSource  = dataSource.Take(10).ToList();
                        rptResults.DataBind();

                        litSearchItem.Text    = query;
                        litResultCount.Text   = dataSource.Count.ToString();
                        panBoardTitle.Visible = false;
                    }
                }
            }
            else
            {
                litGroupName.Text = "Group Search";
            }
        }