Пример #1
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            string ChannelAlias = null;

            try
            {
                ChannelAlias = Request.QueryString["SubAlias"].ToString();
            }
            catch (Exception AliasNull)
            {
                Response.Redirect("HomeLite.aspx");
            }
            string    ChannelGuid  = DataQuery.CategoryAliasToID(ChannelAlias);
            string    CategoryName = DataQuery.GetNameByCategoryAlias(ChannelAlias);
            string    OtherAlias   = DataQuery.GetChannelAliasByName(ConfigurationManager.AppSettings["NewsCategoriesAlias"], CategoryName);
            string    OtherGuid    = DataQuery.CategoryAliasToID(OtherAlias);
            DataTable TopInfo      = DataQuery.ArticleQuerySummary("", "1", ChannelAlias).Tables[0];
            DataTable OtherInfo    = DataQuery.ArticleQuery("", "", OtherAlias).Tables[0];

            TopPicLargeLink.NavigateUrl = "ShowVideo.aspx?ID=" + TopInfo.Rows[0]["ArticleGUID"].ToString();
            PlayLink.NavigateUrl        = "ShowVideo.aspx?ID=" + TopInfo.Rows[0]["ArticleGUID"].ToString();
            TopPicLarge.ImageUrl        = DataQuery.GetCoursePicPath(TopInfo.Rows[0]["ArticleGUID"].ToString(), url, "360x240.png");
            TopPicSmall.ImageUrl        = DataQuery.GetCoursePicPath(TopInfo.Rows[0]["ArticleGUID"].ToString(), url, "001.jpg");
            TopTitle.Text          = DataProcessing.SubstringText(TopInfo.Rows[0]["Title"].ToString(), 17);
            TopSpeaker.Text        = DataProcessing.SubstringText(TopInfo.Rows[0]["Author"].ToString(), 17);
            TopSpeakerInfo.Text    = DataProcessing.SubstringText(TopInfo.Rows[0]["SpeakerInfo"].ToString(), 25);
            TopSpeakerInfo.ToolTip = TopInfo.Rows[0]["SpeakerInfo"].ToString();
            TopSummary.Text        = DataProcessing.SubstringText(DataProcessing.NoHTML(TopInfo.Rows[0]["Summary"].ToString()), 155);
            TopSummary.ToolTip     = DataProcessing.NoHTML(TopInfo.Rows[0]["Summary"].ToString());
            //
            SpecialAttentionLevel2CourseList.DataSource = OtherInfo;
            SpecialAttentionLevel2CourseList.DataBind();
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            string ChannelAlias = Request.QueryString["alias"].ToString();
            string ChannelTitle = DataQuery.GetNameByCategoryAlias(ChannelAlias);
            // 推荐
            String    CommendAlias   = DataQuery.GetChannelAliasByName(ChannelAlias, "推荐");
            string    CommendGuid    = DataQuery.CategoryAliasToID(CommendAlias);
            DataTable CommendCourses = new DAL.Article().GetArticleList(CommendGuid, false, 12);

            CommendList.DataSource = CommendCourses;
            CommendList.DataBind();
            //排行
            //DataTable HotListDataSrc = DataQuery.GetHotList();
            //HotList.DataSource = HotListDataSrc;
            //HotList.DataBind();

            // 主列表
            String    CategoryLv2Alias = DataQuery.GetChannelAliasByName(ChannelAlias, "栏目");
            string    Version          = ConfigurationManager.AppSettings["Version_Mark"];
            DataTable GetSubCategories = DataQuery.GetSubCategoriesApart(CategoryLv2Alias, Version);

            Level2MainRight.DataSource = GetSubCategories;
            Level2MainRight.DataBind();
            Image Level2MainBanner = (Image)FindControl <Image>("Level2MainBanner");

            Level2MainBanner.ImageUrl = "images/AD" + ChannelAlias + ".gif";

            //LeftPic
            LeftPicAliasText          = ConfigurationManager.AppSettings["ChannelPicCategory"];
            LeftPicLv2AliasText       = DataQuery.GetChannelAliasByName(LeftPicAliasText, ChannelTitle);
            Level2LeftPicBot.ImageUrl = "ShowBytePic.aspx?Title=底部图片&Alias=" + LeftPicLv2AliasText;
            int       LeftPicCount            = (GetSubCategories.Rows.Count - 6) / 2;
            String    LeftPicAlias            = DataQuery.GetChannelAliasByName(ChannelAlias, "图片专题");
            DataTable LeftPicGetSubCategories = DataQuery.GetSubCategories(LeftPicAlias, LeftPicCount.ToString());

            LeftPicList.DataSource = LeftPicGetSubCategories;
            LeftPicList.DataBind();
            //Level2LeftPic1.ImageUrl = "images/" + ChannelAlias + "_1.jpg";
            //int SubCategoriesCount = GetSubCategories.Rows.Count;
            //if (SubCategoriesCount >= 10)
            //{
            //    Level2LeftPic2.Visible = true;
            //    Level2LeftPic2.ImageUrl = "images/" + ChannelAlias + "_2.jpg";
            //}
            //if (SubCategoriesCount >= 12)
            //{
            //    Level2LeftPic3.Visible = true;
            //    Level2LeftPic3.ImageUrl = "images/" + ChannelAlias + "_3.jpg";
            //}
            //if (SubCategoriesCount >= 14)
            //{
            //    Level2LeftPic4.Visible = true;
            //    Level2LeftPic4.ImageUrl = "images/" + ChannelAlias + "_4.jpg";
            //}
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            string ChannelAlias = ConfigurationManager.AppSettings["ChannelFame"];
            string ChannelTitle = DataQuery.GetNameByCategoryAlias(ChannelAlias);
            //LeftList1
            string Lv2FameLeftListAlias = DataQuery.GetChannelAliasByName(ChannelAlias, "名家谈时事");

            Lv2FameLeftLink1.NavigateUrl = "Level3Fame.aspx?alias=" + Lv2FameLeftListAlias + "&IsChild=1";
            string    Lv2FameLeftListGuid     = DataQuery.CategoryAliasToID(Lv2FameLeftListAlias);
            DataTable Lv2FameLeftList1Courses = new DAL.Article().GetArticleList(Lv2FameLeftListGuid, false, 3);

            Lv2FameLeftList1.DataSource = Lv2FameLeftList1Courses;
            Lv2FameLeftList1.DataBind();
            //LeftList2
            Lv2FameLeftListAlias         = DataQuery.GetChannelAliasByName(ChannelAlias, "名家谈管理");
            Lv2FameLeftLink2.NavigateUrl = "Level3Fame.aspx?alias=" + Lv2FameLeftListAlias + "&IsChild=1";
            string    Lv2FameLeftListGuid2    = DataQuery.CategoryAliasToID(Lv2FameLeftListAlias);
            DataTable Lv2FameLeftList2Courses = new DAL.Article().GetArticleList(Lv2FameLeftListGuid2, false, 3);

            Lv2FameLeftList2.DataSource = Lv2FameLeftList2Courses;
            Lv2FameLeftList2.DataBind();
            //排行
            //DataTable HotListDataSrc = DataQuery.GetHotList();
            //HotList.DataSource = HotListDataSrc;
            //HotList.DataBind();
            //MidList
            string Lv2FameMidListAlias = DataQuery.GetChannelAliasByName(ChannelAlias, "名师推荐");

            Lv2FameMidLink.NavigateUrl = "Level3Fame.aspx?alias=" + Lv2FameLeftListAlias + "&IsChild=1";
            string    Lv2FameMidListGuid    = DataQuery.CategoryAliasToID(Lv2FameMidListAlias);
            DataTable Lv2FameMidListCourses = new DAL.Article().GetArticleList(Lv2FameMidListGuid, true, 5);

            Lv2FameMidList.DataSource = Lv2FameMidListCourses;
            Lv2FameMidList.DataBind();
            //RightList1
            string Lv2RightListAlias = DataQuery.GetChannelAliasByName(ChannelAlias, "专家名录");

            Lv2FameRightLink1.NavigateUrl = "Level3Fame.aspx?alias=" + Lv2RightListAlias + "&IsChild=0";
            DataTable Lv2RightListItems = DataQuery.GetSubCategories(Lv2RightListAlias, "48");

            Lv2FameRightList1.DataSource = Lv2RightListItems;
            Lv2FameRightList1.DataBind();
        }
Пример #4
0
        // 主列表栏目名

        // 主列表栏连接名
        protected void Level2MainRight_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            Label  CategoryAliasLabel = (Label)e.Item.FindControl("CurrentLv2Alias");
            string CurrentLv2Alias    = CategoryAliasLabel.Text.ToString();

            WebModules.CategoryLv2List CategoryLv2List = new WebModules.CategoryLv2List(CurrentLv2Alias, 1, 5);
            ListView Lv2ListPic  = (ListView)e.Item.FindControl("Lv2ListPic");
            ListView Lv2ListText = (ListView)e.Item.FindControl("Lv2ListText");

            Lv2ListPic.DataSource = CategoryLv2List.PicInfo;
            Lv2ListPic.DataBind();
            Lv2ListText.DataSource = CategoryLv2List.TextInfo;
            Lv2ListText.DataBind();
            Label     Lv2ListTitle = (Label)e.Item.FindControl("Lv2ListTitle");
            HyperLink Lv2ListLink  = (HyperLink)e.Item.FindControl("Lv2ListLink");

            Lv2ListTitle.Text       = DataQuery.GetNameByCategoryAlias(CurrentLv2Alias);
            Lv2ListLink.NavigateUrl = "level3.aspx?alias=" + CurrentLv2Alias + "&IsChild=0";
            BannerCount++;
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            string ChannelAlias = ConfigurationManager.AppSettings["ChannelClass"];
            string ChannelTitle = DataQuery.GetNameByCategoryAlias(ChannelAlias);
            //LeftList1
            string Lv2ClassLeftListAlias = DataQuery.GetChannelAliasByName(ChannelAlias, "国内985大学");

            Lv2ClassLeftLink1.NavigateUrl = "Level3Class.aspx?alias=" + Lv2ClassLeftListAlias + "&IsChild=0";
            DataTable Lv2ClassLeftList1Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6");

            Lv2ClassLeftList1.DataSource = Lv2ClassLeftList1Items;
            Lv2ClassLeftList1.DataBind();
            //LeftList2
            Lv2ClassLeftListAlias         = DataQuery.GetChannelAliasByName(ChannelAlias, "国外大学");
            Lv2ClassLeftLink2.NavigateUrl = "Level3Class.aspx?alias=" + Lv2ClassLeftListAlias + "&IsChild=0";
            DataTable Lv2ClassLeftList2Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6");

            Lv2ClassLeftList2.DataSource = Lv2ClassLeftList2Items;
            Lv2ClassLeftList2.DataBind();
            //排行
            //DataTable HotListDataSrc = DataQuery.GetHotList();
            //HotList.DataSource = HotListDataSrc;
            //HotList.DataBind();
            //MidList
            string Lv2ClassMidListAlias = DataQuery.GetChannelAliasByName(ChannelAlias, "精品课程");

            Lv2ClassMidLink.NavigateUrl = "Level3Class.aspx?alias=" + Lv2ClassMidListAlias + "&IsChild=1";
            DataTable Lv2FameMidListCourses = DataQuery.GetArticleListFromAlias(Lv2ClassMidListAlias, true, "desc", 0, 5);

            Lv2ClassMidList.DataSource = Lv2FameMidListCourses;
            Lv2ClassMidList.DataBind();
            //
            String    CommendAlias   = DataQuery.GetChannelAliasByName(ChannelAlias, "推荐");
            DataTable CommendCourses = DataQuery.GetArticleListFromAlias(CommendAlias, true, "desc", 0, 12);

            CommendList.DataSource = CommendCourses;
            CommendList.DataBind();
        }
Пример #6
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";

            string ChannelTitle = null;

            // 痕迹&栏目标题
            if (Request.QueryString["alias"] == null)
            {
                Response.Redirect("HomeLite.aspx");
            }
            else
            {
                SetAliasAndIsChild();
            }
            string CategoryGUID = DataQuery.CategoryAliasToID(alias);
            string CategoryPath = DataQuery.CategoryPath(CategoryGUID);

            char[]   PathSeparator = { '/' };
            string[] CategoryPaths = CategoryPath.Split(PathSeparator);
            ChannelAlias = DataQuery.CategoryIDToAlias(CategoryPaths[4]);
            string Lv2Alias = DataQuery.CategoryIDToAlias(CategoryPaths[5]);//2级分类

            ChannelTitle = DataQuery.GetNameByCategoryAlias(ChannelAlias);
            //CurrentTrace.Text = ChannelTitle;
            CurrentCategoryName.Text = ChannelTitle;
            //竖导航
            String    Lv2sAlias         = ChannelAlias;
            DataTable Lv2CategoriesInfo = DataQuery.GetSubCategories(Lv2sAlias);

            DataRow[] Lv2Current = Lv2CategoriesInfo.Select("CategoryAlias = '" + Lv2Alias + "'");
            if (Lv2Current.Length > 0)
            {
                Lv2CategoriesIndex = Array.IndexOf(Lv2CategoriesInfo.Select("", "XIndex  asc"), Lv2Current[0]);
            }

            Lv3Navi.DataSource = Lv2CategoriesInfo;
            Lv3Navi.DataBind();
            //主列表
            SetAliasAndIsChild();
            //
            if (Request.QueryString["order"] == null)
            {
                ListOrder         = "desc";
                RadioDesc.Checked = true;
            }
            else
            {
                ListOrder = Request.QueryString["order"].ToString();
                switch (ListOrder)
                {
                case "asc":
                    RadioAsc.Checked = true;
                    break;

                case "desc":
                    RadioDesc.Checked = true;
                    break;

                default:
                    RadioDesc.Checked = true;
                    break;
                }
            }
            //
            ListType = GetListType();
            //
            string guid = DataQuery.CategoryAliasToID(alias);

            if (IsChild == "0")
            {
                switch (ListType)
                {
                case "pic":
                    Level3MainListPic.DataSource = new DAL.Article().GetArticleList(guid, false, ListOrder, true);
                    Level3MainListPic.DataBind();
                    break;

                case "text":
                    Level3MainListText.DataSource = new DAL.Article().GetArticleList(guid, false, ListOrder, true);
                    Level3MainListText.DataBind();
                    break;

                default:
                    Level3MainListPic.DataSource = new DAL.Article().GetArticleList(guid, false, ListOrder, true);
                    Level3MainListPic.DataBind();
                    break;
                }
            }
            else
            {
                switch (ListType)
                {
                case "pic":
                    Level3MainListPic.DataSource = new DAL.Article().GetArticleList(guid, false, ListOrder, false);
                    Level3MainListPic.DataBind();
                    break;

                case "text":
                    Level3MainListText.DataSource = new DAL.Article().GetArticleList(guid, false, ListOrder, false);
                    Level3MainListText.DataBind();
                    break;

                default:
                    Level3MainListPic.DataSource = new DAL.Article().GetArticleList(guid, false, ListOrder, false);
                    Level3MainListPic.DataBind();
                    break;
                }
            }
        }
Пример #7
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";

            string ChannelTitle = null;

            // 痕迹&栏目标题
            try
            {
                Lv2HotAlias = Request.QueryString["alias"].ToString();
                string   Lv2HotCategoryGUID = DataQuery.CategoryAliasToID(Lv2HotAlias);
                string   CategoryPath       = DataQuery.CategoryPath(Lv2HotCategoryGUID);
                char[]   PathSeparator      = { '/' };
                string[] CategoryPaths      = CategoryPath.Split(PathSeparator);
                ChannelAlias             = DataQuery.CategoryIDToAlias(CategoryPaths[4]);
                ChannelTitle             = DataQuery.GetNameByCategoryAlias(ChannelAlias);
                CurrentTrace.Text        = ChannelTitle;
                CurrentCategoryName.Text = ChannelTitle;
            }
            catch (Exception AliasNull)
            {
                Response.Redirect("index.aspx");
            }

            //主列表
            if (Request.QueryString["order"] == null)
            {
                ListOrder         = "desc";
                RadioDesc.Checked = true;
            }
            else
            {
                ListOrder = Request.QueryString["order"].ToString();
                switch (ListOrder)
                {
                case "asc":
                    RadioAsc.Checked = true;
                    break;

                case "desc":
                    RadioDesc.Checked = true;
                    break;

                default:
                    RadioDesc.Checked = true;
                    break;
                }
            }
            ListType = GetListType();
            string Lv2HotGuid = DataQuery.CategoryAliasToID(Lv2HotAlias);

            switch (ListType)
            {
            case "pic":
                Level3MainListPic.DataSource = new DAL.Article().GetArticleList(Lv2HotGuid, false, ListOrder, false);
                Level3MainListPic.DataBind();
                break;

            case "text":
                Level3MainListText.DataSource = new DAL.Article().GetArticleList(Lv2HotGuid, false, ListOrder, false);
                Level3MainListText.DataBind();
                break;

            default:
                Level3MainListPic.DataSource = new DAL.Article().GetArticleList(Lv2HotGuid, false, ListOrder, false);
                Level3MainListPic.DataBind();
                break;
            }

            //竖导航
            DataTable SubNaviDate;
            String    HotAlias = DataQuery.GetChannelAliasByName(ChannelAlias, "热点");

            SubNaviDate           = DataQuery.GetSubCategories(HotAlias);
            Lv3HotNavi.DataSource = SubNaviDate;
            Lv3HotNavi.DataBind();
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";

            string ChannelTitle = null;

            // 痕迹&栏目标题
            if (Request.QueryString["alias"] == null)
            {
                //Response.Redirect("index.aspx");
                alias   = "gxchannel1_topics_1";
                IsChild = "0";
            }
            else
            {
                SetAliasAndIsChild();
            }

            string CategoryGUID = DataQuery.CategoryAliasToID(alias);
            string CategoryPath = DataQuery.CategoryPath(CategoryGUID);

            char[]   PathSeparator = { '/' };
            string[] CategoryPaths = CategoryPath.Split(PathSeparator);
            ChannelAlias = DataQuery.CategoryIDToAlias(CategoryPaths[4]);
            string Lv2Alias = DataQuery.CategoryIDToAlias(CategoryPaths[6]);//2级分类

            ChannelTitle             = DataQuery.GetNameByCategoryAlias(ChannelAlias);
            CurrentTrace.Text        = ChannelTitle;
            CurrentCategoryName.Text = ChannelTitle;
            TraceLv2Link.NavigateUrl = "level2.aspx?alias=" + ChannelAlias;
            //竖导航
            String    Lv2sAlias         = DataQuery.GetChannelAliasByName(ChannelAlias, "栏目");
            DataTable Lv2CategoriesInfo = DataQuery.GetSubCategories(Lv2sAlias);

            DataRow[] Lv2Current = Lv2CategoriesInfo.Select("CategoryAlias = '" + Lv2Alias + "'");
            if (Lv2Current.Length > 0)
            {
                Lv2CategoriesIndex = Array.IndexOf(Lv2CategoriesInfo.Select("", "XIndex  asc"), Lv2Current[0]);
            }

            Lv3Navi.DataSource = Lv2CategoriesInfo;
            Lv3Navi.DataBind();
            //主列表
            if (Request.QueryString["order"] == null)
            {
                ListOrder         = "desc";
                RadioDesc.Checked = true;
            }
            else
            {
                ListOrder = Request.QueryString["order"].ToString();
                switch (ListOrder)
                {
                case "asc":
                    RadioAsc.Checked = true;
                    break;

                case "desc":
                    RadioDesc.Checked = true;
                    break;

                default:
                    RadioDesc.Checked = true;
                    break;
                }
            }
            //
            ListType = GetListType();
            //
            guid = DataQuery.CategoryAliasToID(alias);
            Lv3Pager.PageSize = int.Parse(System.Configuration.ConfigurationManager.AppSettings["PageSize"]);
            if (!IsPostBack)
            {
                DataTable dt = new DAL.Article().GetArticleList(guid, false, "desc", true);
                int       iTotalRowsCount = dt.Rows.Count;
                Lv3Pager.RecordCount = iTotalRowsCount;
                MainDataBind();
            }
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            iPageSize = int.Parse(System.Configuration.ConfigurationManager.AppSettings["PageSize"]);
            //显示方式
            sShow = string.IsNullOrEmpty(Request.QueryString["show"]) ? System.Configuration.ConfigurationManager.AppSettings["DefaultSearchDisplay"] : Request.QueryString["show"];
            DataSet ds = new DataSet();

            DAL.CategoryDAL dal = new DAL.CategoryDAL();
            //排序方式
            sSort = string.IsNullOrEmpty(Request.QueryString["s"]) ? System.Configuration.ConfigurationManager.AppSettings["DefaultSearchSort"] : Request.QueryString["s"];
            if (string.IsNullOrEmpty(sSort))
            {
                sSort = " asc ";
            }

            //当前页面
            int.TryParse(string.IsNullOrEmpty(Request.QueryString["PageNo"]) ? "0" : Request.QueryString["PageNo"], out iPage);
            if (iPage < 1)
            {
                iPage = 1;
            }

            //分页l链接路径
            sUrl = string.Format("?act={0}", Request.QueryString["act"]);
            string sAct = Request.QueryString["act"].Trim().ToLower();

            if (string.IsNullOrEmpty(sAct) || sAct == "h")
            {
                //热点
                if (string.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    return;
                }
                sCategoryGUID = Request.QueryString["ID"];
                sUrl         += string.Format("&ID={0}", sCategoryGUID);
                dtArt         = new DAL.Article().GetArticleList(sCategoryGUID, true, sSort, iPage, out iTotalRowsCount);
                sActionStr    = "热门关键词";
            }
            else if (sAct == "lv2h")//*CC*
            {
                //二级左下
                if (string.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    return;
                }
                sCategoryGUID = Request.QueryString["ID"];
                sUrl         += string.Format("&ID={0}", sCategoryGUID);
                dtArt         = new DAL.Article().GetArticleList(sCategoryGUID, true, sSort, iPage, out iTotalRowsCount);
                string   Lv2CategoryPath      = DataQuery.CategoryPath(sCategoryGUID);
                string[] Lv2CategoryPathArray = Lv2CategoryPath.Split('/');
                string   Lv2CategoryAlias     = DataQuery.CategoryIDToAlias(Lv2CategoryPathArray[4].ToString());
                string   Lv2CategoryName      = DataQuery.GetNameByCategoryAlias(Lv2CategoryAlias);
                string   Lv3CategoryName      = DataQuery.GetNameByCategoryID(sCategoryGUID);
                TraceLv2Link.NavigateUrl = "level2.aspx?alias=" + Lv2CategoryAlias;
                TraceLv2Name.Text        = Lv2CategoryName;
                sActionStr = ">&nbsp;" + Lv3CategoryName;
            }
            else if (sAct == "n")
            {
                //简单搜索
                sActionStr = "简单搜索";
                sKeyWords  = Request.QueryString["keywords"];
                (this.Page.Master as MasterPager.HomeLite).sSearchKeyWords = sKeyWords;
                string EnCodeKeyWords = Server.UrlEncode(sKeyWords);
                sUrl     += string.Format("&keywords={0}", EnCodeKeyWords);
                sKeyWords = sKeyWords.Trim().Replace("+", ",").Replace(" ", ",").Replace("  ", ",").Replace(" ", ",").Replace(",", ",").Replace("|", "|").Replace("、", "|").Replace("(", "%").Replace(")", "%").Replace(")", "%").Replace("(", "%").Replace("[", "%").Replace("]", "%").Replace("[", "%").Replace("]", "%").Replace(":", "%").Replace(":", "%").Replace(",,", ",").Replace("%%", "%");
                //CC 增加符号
                sSearchWhere = dal.GetArticleSearchContent(sKeyWords);
                ds           = dal.GetSearchArticleList(sSearchWhere, iPage, iPageSize, sSort);
                dtArt        = ds.Tables[0];
                if (!ds.Tables[1].Rows[0][0].Equals(null))
                {
                    int.TryParse(ds.Tables[1].Rows[0][0].ToString(), out iTotalRowsCount);
                }
                else
                {
                    iTotalRowsCount = 0;
                }
            }
            else if (sAct == "a")
            {
                //高级检索
                sActionStr = "高级搜索";
            }
            else if (sAct == "zt")
            {
                sActionStr   = "专题搜索";
                sKeyWords    = Request.QueryString["keywords"];
                sUrl        += string.Format("&keywords={0}", sKeyWords);
                sShow        = "Thumb";
                sKeyWords    = sKeyWords.Trim().Replace("+", ",").Replace(" ", ",").Replace("  ", ",").Replace(",", ",").Replace("|", "|").Replace("、", "|").Replace(",,", ",");
                sSearchWhere = dal.GetSearchContentByKeyWords(sKeyWords, "CategoryName");

                ds    = dal.GetSearchZTList(sSearchWhere, iPage, iPageSize, sSort);
                dtArt = ds.Tables[0];
                if (!ds.Tables[1].Rows[0][0].Equals(null))
                {
                    int.TryParse(ds.Tables[1].Rows[0][0].ToString(), out iTotalRowsCount);
                }
                else
                {
                    iTotalRowsCount = 0;
                }
            }
            else if (sAct == "author")
            {
                //作者搜索
                sActionStr = "简单搜索";
                sKeyWords  = Request.QueryString["keywords"];
                sUrl      += string.Format("&keywords={0}", sKeyWords);
                sKeyWords  = sKeyWords.Trim().Replace("+", ",").Replace(" ", ",").Replace("  ", ",").Replace(",", ",").Replace("|", "|").Replace("、", "|").Replace(",,", ",");

                sSearchWhere = dal.GetSearchContentByKeyWords(sKeyWords, "Author");
                ds           = dal.GetSearchArticleList(sSearchWhere, iPage, iPageSize, sSort);
                dtArt        = ds.Tables[0];
                if (!ds.Tables[1].Rows[0][0].Equals(null))
                {
                    int.TryParse(ds.Tables[1].Rows[0][0].ToString(), out iTotalRowsCount);
                }
                else
                {
                    iTotalRowsCount = 0;
                }
            }
            sActionStr = string.Format("{0} {1}", sActionStr, string.IsNullOrEmpty(sKeyWords) ? string.Empty : string.Format("关键词:<b>{0}</b>", sKeyWords));
            int    iDescLength = (sAct == "zt") ? 270 : 63;
            string sDesc       = string.Empty;
            string sContent    = string.Empty;

            foreach (DataRow dr in dtArt.Rows)
            {
                string sDate = DateTime.Parse(dr["CreateTime"].ToString()).ToString("yyyy-MM-dd");
                if (sAct != "zt")
                {
                    sOutTrStr += string.Format("<tr><td class=\"MainListTitle\"><a href=\"{0}\">{1}</a></td><td>{2}</td><td>{3}分钟</td><td>{4}</td></tr>",
                                               string.Format("ShowVideo.aspx?ID={0}", dr["ArticleGUID"]),
                                               dr["Title"],
                                               dr["Author"],
                                               dr["Duration"],
                                               sDate);
                }
                sOutLiStr += "<li>";
                string sImg = (sAct == "zt") ? string.Format("ShowZTImage.aspx?Title={0}", dr["CategoryName"]) : DAL.Article.GetArticleImgPath(dr["Filename"].ToString(), dr["CoursePicture"].ToString());
                if (sAct == "zt")//*CC*
                {
                    sOutLiStr += string.Format("<a href=\"{1}\" target=\"_blank\"><img class=\"SearchResultContentDetailPreview\" src=\"{0}\" /></a>", sImg, string.Format("SpecialAttention.aspx?ID={0}&Title={1}", dr["CategoryGUID"], HttpUtility.UrlEncode(dr["CategoryName"].ToString())));
                }
                else
                {
                    sOutLiStr += string.Format("<a href=\"{1}\" target=\"_blank\"><img class=\"SearchResultContentDetailPreview\" src=\"{0}\" /></a>", sImg, string.Format("ShowVideo.aspx?ID={0}", dr["ArticleGUID"]));
                }
                string sTemp = " <div class=\"SearchResultDetailLeft\">";
                if (sAct == "zt")
                {
                    sTemp += string.Format("<div class=\"SearchResultDetailTitle\"><a href=\"{0}\" target=\"_blank\">{1}</a></div>", string.Format("SpecialAttention.aspx?ID={0}&Title={1}", dr["CategoryGUID"], HttpUtility.UrlEncode(dr["CategoryName"].ToString())), dr["CategoryName"]);
                }
                else
                {
                    sTemp += string.Format("<div class=\"SearchResultDetailTitle\"><a href=\"{0}\" target=\"_blank\">{1}</a></div>", string.Format("ShowVideo.aspx?ID={0}", dr["ArticleGUID"]), dr["Title"]);
                }
                if (sAct != "zt")
                {
                    sTemp += "<table class=\"SearchResultDetailInfo\">";
                    string sAuthor = string.Format("<a href=\"Search.aspx?act=author&keywords={0}\" target=\"_blank\">{0}</a>", dr["Author"]);
                    sTemp += string.Format("<tr><td><span>主讲人:</span> <span class=\"SearchResultInfoTxt\">{0}</span></td><td><span>职务:</span> <span class=\"SearchResultInfoTxt\">{1}</span></td></tr>", sAuthor, dr["SpeakerInfo"]);
                    sTemp += string.Format("<tr><td><span>时长:</span> <span class=\"SearchResultInfoTxt\">{0}分钟</span></td><td><span>日期:</span> <span class=\"SearchResultInfoTxt\">{1}</span></td></tr>", dr["Duration"], sDate);
                    sTemp += "</table> ";
                }
                sTemp += "</div>";
                if (sAct == "zt")
                {
                    string sTitle = dr["CategoryName"].ToString();
                    sContent = new DAL.CategoryDAL().GetZTSummaryFromTitle(sZTSummaryAlias, sTitle);
                }
                else
                {
                    sContent = string.IsNullOrEmpty(dr["Summary"].ToString()) ? string.Empty : DAL.Article.RemoveHtml(dr["Summary"].ToString());
                }
                sContent = DAL.Article.RemoveHtml(sContent);
                if (sContent.Length > iDescLength)
                {
                    sDesc    = sContent.Remove(0, iDescLength);
                    sContent = sContent.Substring(0, iDescLength);
                }
                else
                {
                    sDesc = string.Empty;
                }
                sTemp += string.Format("<div class=\"SearchResultDetailSummary\" data-tooltip=\"{0}\" data-placement=\"bottom\">简介:<span>{1}</span></div>", string.IsNullOrEmpty(sDesc) ? string.Empty : string.Format("<div class='divTooltip'>{0}</div>", sDesc), sContent);

                sOutLiStr += string.Format("<div class=\"SearchResultContentDetailInfo\">{0}</div>", sTemp);
                sOutLiStr += "</li>";
            }
            sSplitContent = GetSplitHtml(iPage, iTotalRowsCount, iPageSize, sUrl);
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            string ChannelAlias = "";
            string ChannelTitle = "";

            try
            {
                ChannelAlias = Request.QueryString["alias"].ToString();
            }
            catch
            {
                ChannelAlias = "gxchannel1";
            }
            ChannelTitle = DataQuery.GetNameByCategoryAlias(ChannelAlias);
            // 推荐
            String    CommendAlias   = DataQuery.GetChannelAliasByName(ChannelAlias, "推荐");
            string    CommendGuid    = DataQuery.CategoryAliasToID(CommendAlias);
            DataTable CommendCourses = new DAL.Article().GetArticleList(CommendGuid, false, 12);

            CommendList.DataSource = CommendCourses;
            CommendList.DataBind();
            //排行
            //DataTable HotListDataSrc = DataQuery.GetHotList();
            //HotList.DataSource = HotListDataSrc;
            //HotList.DataBind();

            // 主列表
            String    CategoryLv2Alias = DataQuery.GetChannelAliasByName(ChannelAlias, "栏目");
            string    Version          = ConfigurationManager.AppSettings["Version_Mark"];
            DataTable GetSubCategories = DataQuery.GetSubCategoriesApart(CategoryLv2Alias, Version);

            // Level2MainRight.DataSource = GetSubCategories;
            // Level2MainRight.DataBind();
            // Image Level2MainBanner = (Image)FindControl<Image>("Level2MainBanner");
            //Level2MainBanner.ImageUrl = "images/AD" + ChannelAlias + ".gif";

            //LeftPic
            LeftPicAliasText    = ConfigurationManager.AppSettings["ChannelPicCategory"];
            LeftPicLv2AliasText = DataQuery.GetChannelAliasByName(LeftPicAliasText, ChannelTitle);
            //Level2LeftPicBot.ImageUrl = "ShowBytePic.aspx?Title=底部图片&Alias=" + LeftPicLv2AliasText;
            //int LeftPicCount = (GetSubCategories.Rows.Count - 6) / 2;
            int       LeftPicCount            = 1;
            String    LeftPicAlias            = DataQuery.GetChannelAliasByName(ChannelAlias, "图片专题");
            DataTable LeftPicGetSubCategories = DataQuery.GetSubCategories(LeftPicAlias, LeftPicCount.ToString());

            LeftPicList.DataSource = LeftPicGetSubCategories;
            LeftPicList.DataBind();
            //Level2LeftPic1.ImageUrl = "images/" + ChannelAlias + "_1.jpg";
            //int SubCategoriesCount = GetSubCategories.Rows.Count;
            //if (SubCategoriesCount >= 10)
            //{
            //    Level2LeftPic2.Visible = true;
            //    Level2LeftPic2.ImageUrl = "images/" + ChannelAlias + "_2.jpg";
            //}
            //if (SubCategoriesCount >= 12)
            //{
            //    Level2LeftPic3.Visible = true;
            //    Level2LeftPic3.ImageUrl = "images/" + ChannelAlias + "_3.jpg";
            //}
            //if (SubCategoriesCount >= 14)
            //{
            //    Level2LeftPic4.Visible = true;
            //    Level2LeftPic4.ImageUrl = "images/" + ChannelAlias + "_4.jpg";
            //}
            String CategoryGUID = "";
            string TraceText    = "";

            if (Request.QueryString["id"] == null)
            {
                CategoryGUID = "1c68f666dc914382b95456acf6be87a5";
            }
            else
            {
                CategoryGUID = Request.QueryString["id"].ToString();
            }
            char[] PathSeparator = { '/' };
            string CategoryPath  = DataQuery.CategoryPath(CategoryGUID);

            string[] CategoryPaths = CategoryPath.Split(PathSeparator);
            for (int i = 4; i < CategoryPaths.Length; i++)
            {
                string title = DataQuery.GetNameByCategoryID(CategoryPaths[i]);
                TraceText += title + " / ";
            }
            Trace.Text = TraceText;
        }