예제 #1
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";
            //}
        }
예제 #2
0
        protected void Lv3NaviLv2Items_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            Label     CategoryAliasLabel = (Label)e.Item.FindControl("CurrentLv3Alias");
            string    CurrentLv3Alias    = CategoryAliasLabel.Text.ToString();
            DataTable Lv3CategoriesInfo  = DataQuery.GetSubCategories(CurrentLv3Alias);
            ListView  Lv3NaviLv3Items    = (ListView)e.Item.FindControl("Lv3NaviLv3Items");

            Lv3NaviLv3Items.DataSource = Lv3CategoriesInfo;
            Lv3NaviLv3Items.DataBind();
        }
예제 #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 Page_Load(object sender, EventArgs e)
        {
            //导航
            string    NaviList1Alias = ConfigurationManager.AppSettings["subject"];
            DataTable NaviList1Items = DataQuery.GetSubCategories(NaviList1Alias);

            NaviList1.DataSource = NaviList1Items;
            NaviList1.DataBind();
            string    NaviList2Alias = ConfigurationManager.AppSettings["MAJOR"];
            DataTable NaviList2Items = DataQuery.GetSubCategories(NaviList2Alias);

            NaviList2.DataSource = NaviList2Items;
            NaviList2.DataBind();
            string    NaviList3Alias = ConfigurationManager.AppSettings["INSTITUTION"];
            DataTable NaviList3Items = DataQuery.GetSubCategories(NaviList3Alias);

            NaviList3.DataSource = NaviList3Items;
            NaviList3.DataBind();
        }
예제 #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 UpdateBtn_Click(object sender, EventArgs e)
        {
            //System.Threading.Thread.Sleep(2000);
            string ChannelListAliasA1 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_1"];

            WebModules.HomeChannelListA HomeChannelListA1 = new WebModules.HomeChannelListA(ChannelListAliasA1);
            // ColumnShowSort1.DataSource = HomeChannelListA1.SubSortTable;
            // ColumnShowSort1.DataBind();
            // ColumnVideo1.DataSource = HomeChannelListA1.PicInfo;
            //ColumnVideo1.DataBind();
            // ColumnOtherL1.DataSource = HomeChannelListA1.TextInfoL;
            // ColumnOtherL1.DataBind();
            // ColumnOtherR1.DataSource = HomeChannelListA1.TextInfoR;
            // ColumnOtherR1.DataBind();
            string ChannelListATitle1 = ConfigurationManager.AppSettings["HomeChannelListA_Title_1"];
            // ListATitle1.Text = ChannelListATitle1;
            // ListALink1.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA1;

            string ChannelListAliasA2 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_2"];

            WebModules.HomeChannelListA HomeChannelListA2 = new WebModules.HomeChannelListA(ChannelListAliasA2);
            // ColumnShowSort2.DataSource = HomeChannelListA2.SubSortTable;
            //ColumnShowSort2.DataBind();
            // ColumnVideo2.DataSource = HomeChannelListA2.PicInfo;
            // ColumnVideo2.DataBind();
            // ColumnOtherL2.DataSource = HomeChannelListA2.TextInfoL;
            // ColumnOtherL2.DataBind();
            // ColumnOtherR2.DataSource = HomeChannelListA2.TextInfoR;
            // ColumnOtherR2.DataBind();
            string ChannelListATitle2 = ConfigurationManager.AppSettings["HomeChannelListA_Title_2"];
            // ListATitle2.Text = ChannelListATitle2;
            // ListALink2.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA2;

            string ChannelListAliasA3 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_3"];

            WebModules.HomeChannelListA HomeChannelListA3 = new WebModules.HomeChannelListA(ChannelListAliasA3);
            //ColumnShowSort3.DataSource = HomeChannelListA3.SubSortTable;
            // ColumnShowSort3.DataBind();
            //ColumnVideo3.DataSource = HomeChannelListA3.PicInfo;
            // ColumnVideo3.DataBind();
            // ColumnOtherL3.DataSource = HomeChannelListA3.TextInfoL;
            // ColumnOtherL3.DataBind();
            //ColumnOtherR3.DataSource = HomeChannelListA3.TextInfoR;
            // ColumnOtherR3.DataBind();
            string ChannelListATitle3 = ConfigurationManager.AppSettings["HomeChannelListA_Title_3"];
            // ListATitle3.Text = ChannelListATitle3;
            // ListALink3.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA3;

            string ChannelListAliasA4 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_4"];

            WebModules.HomeChannelListA HomeChannelListA4 = new WebModules.HomeChannelListA(ChannelListAliasA4);
            //ColumnShowSort4.DataSource = HomeChannelListA4.SubSortTable;
            //ColumnShowSort4.DataBind();
            //ColumnVideo4.DataSource = HomeChannelListA4.PicInfo;
            // ColumnVideo4.DataBind();
            // ColumnOtherL4.DataSource = HomeChannelListA4.TextInfoL;
            //ColumnOtherL4.DataBind();
            // ColumnOtherR4.DataSource = HomeChannelListA4.TextInfoR;
            // ColumnOtherR4.DataBind();
            string ChannelListATitle4 = ConfigurationManager.AppSettings["HomeChannelListA_Title_4"];
            // ListATitle4.Text = ChannelListATitle4;
            // ListALink4.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA4;

            //右侧列表
            string ChannelListAliasB2 = ConfigurationManager.AppSettings["HomeChannelListB_CategoryAlias_2"];

            WebModules.HomeChannelListB HomeChannelListB2 = new WebModules.HomeChannelListB(ChannelListAliasB2, 1, 8);
            // VerticalShowVideo2.DataSource = HomeChannelListB2.PicInfo;
            // VerticalShowVideo2.DataBind();
            // VerticalShowList2.DataSource = HomeChannelListB2.TextInfo;
            // VerticalShowList2.DataBind();
            string ChannelListBTitle2 = ConfigurationManager.AppSettings["HomeChannelListB_Title_2"];
            // ListBTitle2.Text = ChannelListBTitle2;
            // ListBLink2.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasB2;

            string ChannelListAliasB3 = ConfigurationManager.AppSettings["HomeChannelListB_CategoryAlias_3"];

            WebModules.HomeChannelListB HomeChannelListB3 = new WebModules.HomeChannelListB(ChannelListAliasB3, 1, 4);
            // VerticalShowVideo3.DataSource = HomeChannelListB3.PicInfo;
            // VerticalShowVideo3.DataBind();
            // VerticalShowList3.DataSource = HomeChannelListB3.TextInfo;
            //  VerticalShowList3.DataBind();
            string ChannelListBTitle3 = ConfigurationManager.AppSettings["HomeChannelListB_Title_3"];
            //  ListBTitle3.Text = ChannelListBTitle3;
            // ListBLink3.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasB3;
            //右侧名家
            string ChannelListAliasBS1 = ConfigurationManager.AppSettings["HomeChannelListBS_CategoryAlias_1"];

            WebModules.HomeChannelListBS HomeChannelListBS1 = new WebModules.HomeChannelListBS(ChannelListAliasBS1, 2);
            //VerticalShowVideo1.DataSource = HomeChannelListBS1.PicInfo;
            // VerticalShowVideo1.DataBind();
            string ChannelListBSTitle1 = ConfigurationManager.AppSettings["HomeChannelListBS_Title_1"];
            // ListBTitle1.Text = ChannelListBSTitle1;
            string FameAlias = ConfigurationManager.AppSettings["ChannelFame"];
            // ListBLink1.NavigateUrl = "level2.aspx?alias=" + FameAlias;
            //右侧公开课
            string ChannelListAliasBS2 = ConfigurationManager.AppSettings["ChannelClass"];
            //WebModules.HomeChannelListBS HomeChannelListBS2 = new WebModules.HomeChannelListBS(ChannelListAliasBS2, 2);
            //VerticalShowVideo4.DataSource = HomeChannelListBS2.PicInfo;
            //VerticalShowVideo4.DataBind();
            //LeftList
            string    Lv2ClassLeftListAlias  = DataQuery.GetChannelAliasByName(ChannelListAliasBS2, "国内985大学");
            DataTable Lv2ClassLeftList1Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6");

            //  TabIndex2List1.DataSource = Lv2ClassLeftList1Items;
            // TabIndex2List1.DataBind();
            //LeftList
            Lv2ClassLeftListAlias = DataQuery.GetChannelAliasByName(ChannelListAliasBS2, "国外大学");
            DataTable Lv2ClassLeftList2Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6");
            // TabIndex2List2.DataSource = Lv2ClassLeftList2Items;
            // TabIndex2List2.DataBind();
        }
예제 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CacheTest.Text = DateTime.Now.ToString();

            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";

            //图片新闻
            // Text
            string    NewsCommendAlias = ConfigurationManager.AppSettings["NewsCommendAlias"];
            DataTable NewsCommendText  = new DataTable();

            NewsCommendText         = DataQuery.GetSubCategories(NewsCommendAlias);
            FocusTabsTxt.DataSource = NewsCommendText;
            FocusTabsTxt.DataBind();
            //  Pic
            if (NewsCommendText.Rows.Count > 0)
            {
                DataTable NewsCommendPic = new DataTable();
                //NewsCommendPic = new DAL.Article().GetArticleList(NewsCommendText.Rows[0][1].ToString(),false,1); //缓存
                NewsCommendPic = DataQuery.ArticleQuery("", "1", NewsCommendText.Rows[0][2].ToString()).Tables[0];
                if (NewsCommendPic != null)
                {
                    NewsCommendPic.Columns.Add("FocusTabsIndex", typeof(String));
                    NewsCommendPic.Rows[0]["FocusTabsIndex"] = NewsCommendText.Rows[0]["XIndex"];
                    DataTable NewsCommendPicMerge = new DataTable();
                    for (int i = 1; i < NewsCommendText.Rows.Count; i++)
                    {
                        //NewsCommendPicMerge = new DAL.Article().GetArticleList(NewsCommendText.Rows[i][1].ToString(),false,1); //缓存
                        NewsCommendPicMerge = DataQuery.ArticleQuery("", "1", NewsCommendText.Rows[i][2].ToString()).Tables[0];
                        NewsCommendPicMerge.Columns.Add("FocusTabsIndex", typeof(String));
                        NewsCommendPicMerge.Rows[0]["FocusTabsIndex"] = NewsCommendText.Rows[i]["XIndex"];
                        NewsCommendPic.Merge(NewsCommendPicMerge);
                    }
                    FocusTabsPic.DataSource = NewsCommendPic;
                    FocusTabsPic.DataBind();
                }
            }

            //特别关注
            string    SubjectGUID = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["TBGZ_Alias"]);
            string    SubjectPath = DataQuery.CategoryPath(SubjectGUID); //专题路径
            DataTable HotSubjects = new DataTable();

            HotSubjects = DataQuery.GetNHotZT();
            //  获取课件
            //string SubjectHotGUID = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["SAHot_Alias"]);
            // string SubjectHotPath = DataQuery.CategoryPath(SubjectGUID);
            DataTable HotCoursesMerge = new DataTable();

            // 第一个专题
            if (HotSubjects.Rows.Count > 0)
            {
                //string SubjectHotItemPath = SubjectPath + "/" + HotSubjects.Rows[0][0].ToString();
                // DataTable HotCourses = new DAL.CategoryDAL().GetArticleIndexList(SubjectHotItemPath, "最新动态", 2, false);
                string    HotSubjectAlias = DataQuery.CategoryIDToAlias(HotSubjects.Rows[0][0].ToString());
                string    SubjectNewAlias = DataQuery.GetChannelAliasByName(HotSubjectAlias, "最新动态");
                string    SubjectNewGuid  = DataQuery.CategoryAliasToID(SubjectNewAlias);
                DataTable HotCourses      = new DAL.Article().GetArticleList(SubjectNewGuid, false, 2);
                HotCourses.Columns.Add("SubjectID", Type.GetType("System.String"));
                HotCourses.Columns.Add("SubjectTitle", Type.GetType("System.String"));
                for (int i = 0; i < HotCourses.Rows.Count; i++)
                {
                    HotCourses.Rows[i]["SubjectID"]    = HotSubjects.Rows[0][0].ToString();
                    HotCourses.Rows[i]["SubjectTitle"] = HotSubjects.Rows[0][1].ToString();
                }
                //  后N个专题
                for (int i = 1; i < HotSubjects.Rows.Count; i++)
                {
                    //SubjectHotItemPath = SubjectPath + "/" + HotSubjects.Rows[i][0].ToString();
                    //HotCoursesMerge = new DAL.CategoryDAL().GetArticleIndexList(SubjectHotItemPath, "最新动态", 2, false);
                    HotSubjectAlias = DataQuery.CategoryIDToAlias(HotSubjects.Rows[i][0].ToString());
                    SubjectNewGuid  = DataQuery.GetSubChannelGuidByName(HotSubjectAlias, "最新动态");
                    HotCoursesMerge = new DAL.Article().GetArticleList(SubjectNewGuid, false, 2);
                    HotCoursesMerge.Columns.Add("SubjectID", Type.GetType("System.String"));
                    HotCoursesMerge.Columns.Add("SubjectTitle", Type.GetType("System.String"));
                    for (int j = 0; j < HotCoursesMerge.Rows.Count; j++)
                    {
                        HotCoursesMerge.Rows[j]["SubjectID"]    = HotSubjects.Rows[i][0].ToString();
                        HotCoursesMerge.Rows[j]["SubjectTitle"] = HotSubjects.Rows[i][1].ToString();
                    }
                    HotCourses.Merge(HotCoursesMerge);
                }
                SpecialFocusContent.DataSource = HotCourses;
                SpecialFocusContent.DataBind();
            }

            //热点
            ZjspccmEntities DB    = new ZjspccmEntities();
            var             query = (from cn in DB.CategoryNodePositions
                                     join c in DB.Categories
                                     on cn.CategoryGUID equals c.CategoryGUID
                                     where (cn.CategoryPath.Contains("0c46ef80013847acb095bb5c902d08bd")) && (cn.YIndex == 5)
                                     orderby cn.XIndex descending
                                     select new
            {
                title = c.CategoryName,
                id = c.CategoryGUID
            }).Take(8);

            ListViewHotpoint.DataSource = query.ToList();
            ListViewHotpoint.DataBind();
            //树
            if (!Page.IsPostBack)
            {
                #region sync
                //SeminarTree.ShowLines = true;
                //SeminarTree.ShowExpandCollapse = true;
                TreeNodeCollection tnc = new TreeNodeCollection();
                //tnc = SeminarTree.Nodes;
                //tncRecursion(tnc, "2461c3d8f92d451599e054c1fb46fa11");

                //TreeNodeCollection tnc2 = new TreeNodeCollection();
                //tnc2 = SujectTree.Nodes;
                //tncRecursion(tnc2, "50ac3b6925644d269836e0a45e4671b4");
                #endregion sync
            }
            #region async
            //SeminarTree.Nodes.Clear();
            //Bind_Root("2461c3d8f92d451599e054c1fb46fa11", SeminarTree);
            #endregion async
            //导航
            string    NaviList1Alias = ConfigurationManager.AppSettings["subject"];
            DataTable NaviList1Items = DataQuery.GetSubCategories(NaviList1Alias, "9");
            //NaviList1.DataSource = NaviList1Items;
            // NaviList1.DataBind();
            string    NaviList2Alias = ConfigurationManager.AppSettings["MAJOR"];
            DataTable NaviList2Items = DataQuery.GetSubCategories(NaviList2Alias, "9");
            //NaviList2.DataSource = NaviList2Items;
            // NaviList2.DataBind();
            string    NaviList3Alias = ConfigurationManager.AppSettings["INSTITUTION"];
            DataTable NaviList3Items = DataQuery.GetSubCategories(NaviList3Alias, "9");
            // NaviList3.DataSource = NaviList3Items;
            // NaviList3.DataBind();
            //主列表
            string ChannelListAliasA1 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_1"];
            WebModules.HomeChannelListA HomeChannelListA1 = new WebModules.HomeChannelListA(ChannelListAliasA1);
            // ColumnShowSort1.DataSource = HomeChannelListA1.SubSortTable;
            //ColumnShowSort1.DataBind();
            //ColumnVideo1.DataSource = HomeChannelListA1.PicInfo;
            // ColumnVideo1.DataBind();
            // ColumnOtherL1.DataSource = HomeChannelListA1.TextInfoL;
            //ColumnOtherL1.DataBind();
            // ColumnOtherR1.DataSource = HomeChannelListA1.TextInfoR;
            // ColumnOtherR1.DataBind();
            string ChannelListATitle1 = ConfigurationManager.AppSettings["HomeChannelListA_Title_1"];
            // ListATitle1.Text = ChannelListATitle1;
            // ListALink1.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA1;

            string ChannelListAliasA2 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_2"];
            WebModules.HomeChannelListA HomeChannelListA2 = new WebModules.HomeChannelListA(ChannelListAliasA2);
            // ColumnShowSort2.DataSource = HomeChannelListA2.SubSortTable;
            // ColumnShowSort2.DataBind();
            // ColumnVideo2.DataSource = HomeChannelListA2.PicInfo;
            // ColumnVideo2.DataBind();
            //ColumnOtherL2.DataSource = HomeChannelListA2.TextInfoL;
            // ColumnOtherL2.DataBind();
            // ColumnOtherR2.DataSource = HomeChannelListA2.TextInfoR;
            // ColumnOtherR2.DataBind();
            string ChannelListATitle2 = ConfigurationManager.AppSettings["HomeChannelListA_Title_2"];
            // ListATitle2.Text = ChannelListATitle2;
            //ListALink2.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA2;

            string ChannelListAliasA3 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_3"];
            WebModules.HomeChannelListA HomeChannelListA3 = new WebModules.HomeChannelListA(ChannelListAliasA3);
            // ColumnShowSort3.DataSource = HomeChannelListA3.SubSortTable;
            // ColumnShowSort3.DataBind();
            // ColumnVideo3.DataSource = HomeChannelListA3.PicInfo;
            // ColumnVideo3.DataBind();
            // ColumnOtherL3.DataSource = HomeChannelListA3.TextInfoL;
            // ColumnOtherL3.DataBind();
            // ColumnOtherR3.DataSource = HomeChannelListA3.TextInfoR;
            // ColumnOtherR3.DataBind();
            string ChannelListATitle3 = ConfigurationManager.AppSettings["HomeChannelListA_Title_3"];
            // ListATitle3.Text = ChannelListATitle3;
            // ListALink3.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA3;

            string ChannelListAliasA4 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_4"];
            WebModules.HomeChannelListA HomeChannelListA4 = new WebModules.HomeChannelListA(ChannelListAliasA4);
            // ColumnShowSort4.DataSource = HomeChannelListA4.SubSortTable;
            // ColumnShowSort4.DataBind();
            // ColumnVideo4.DataSource = HomeChannelListA4.PicInfo;
            // ColumnVideo4.DataBind();
            //ColumnOtherL4.DataSource = HomeChannelListA4.TextInfoL;
            //ColumnOtherL4.DataBind();
            // ColumnOtherR4.DataSource = HomeChannelListA4.TextInfoR;
            // ColumnOtherR4.DataBind();
            string ChannelListATitle4 = ConfigurationManager.AppSettings["HomeChannelListA_Title_4"];
            // ListATitle4.Text = ChannelListATitle4;
            // ListALink4.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA4;

            //右侧列表
            string ChannelListAliasB2 = ConfigurationManager.AppSettings["HomeChannelListB_CategoryAlias_2"];
            WebModules.HomeChannelListB HomeChannelListB2 = new WebModules.HomeChannelListB(ChannelListAliasB2, 1, 8);
            //VerticalShowVideo2.DataSource = HomeChannelListB2.PicInfo;
            // VerticalShowVideo2.DataBind();
            // VerticalShowList2.DataSource = HomeChannelListB2.TextInfo;
            // VerticalShowList2.DataBind();
            string ChannelListBTitle2 = ConfigurationManager.AppSettings["HomeChannelListB_Title_2"];
            //  ListBTitle2.Text = ChannelListBTitle2;
            //  ListBLink2.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasB2;

            string ChannelListAliasB3 = ConfigurationManager.AppSettings["HomeChannelListB_CategoryAlias_3"];
            WebModules.HomeChannelListB HomeChannelListB3 = new WebModules.HomeChannelListB(ChannelListAliasB3, 1, 4);
            //VerticalShowVideo3.DataSource = HomeChannelListB3.PicInfo;
            //  VerticalShowVideo3.DataBind();
            // VerticalShowList3.DataSource = HomeChannelListB3.TextInfo;
            // VerticalShowList3.DataBind();
            string ChannelListBTitle3 = ConfigurationManager.AppSettings["HomeChannelListB_Title_3"];
            //  ListBTitle3.Text = ChannelListBTitle3;
            //  ListBLink3.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasB3;
            //右侧名家
            string ChannelListAliasBS1 = ConfigurationManager.AppSettings["HomeChannelListBS_CategoryAlias_1"];
            WebModules.HomeChannelListBS HomeChannelListBS1 = new WebModules.HomeChannelListBS(ChannelListAliasBS1, 2);
            //  VerticalShowVideo1.DataSource = HomeChannelListBS1.PicInfo;
            // VerticalShowVideo1.DataBind();
            string ChannelListBSTitle1 = ConfigurationManager.AppSettings["HomeChannelListBS_Title_1"];
            // ListBTitle1.Text = ChannelListBSTitle1;
            string FameAlias = ConfigurationManager.AppSettings["ChannelFame"];
            // ListBLink1.NavigateUrl = "level2.aspx?alias=" + FameAlias;
            //右侧公开课
            string ChannelListAliasBS2 = ConfigurationManager.AppSettings["ChannelClass"];
            //WebModules.HomeChannelListBS HomeChannelListBS2 = new WebModules.HomeChannelListBS(ChannelListAliasBS2, 2);
            //VerticalShowVideo4.DataSource = HomeChannelListBS2.PicInfo;
            //VerticalShowVideo4.DataBind();
            //LeftList
            string    Lv2ClassLeftListAlias  = DataQuery.GetChannelAliasByName(ChannelListAliasBS2, "国内985大学");
            DataTable Lv2ClassLeftList1Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6");
            // TabIndex2List1.DataSource = Lv2ClassLeftList1Items;
            // TabIndex2List1.DataBind();
            //LeftList
            Lv2ClassLeftListAlias = DataQuery.GetChannelAliasByName(ChannelListAliasBS2, "国外大学");
            DataTable Lv2ClassLeftList2Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6");
            // TabIndex2List2.DataSource = Lv2ClassLeftList2Items;
            // TabIndex2List2.DataBind();

            //下方列表
            string    SkillListAlias    = ConfigurationManager.AppSettings["HomeChannelListC_CategoryAlias"];
            DataTable SkillCategoryInfo = DataQuery.GetSubCategoriesNote(DataQuery.GetChannelAliasByName(SkillListAlias, "栏目"), "8");
            SkillTabs.DataSource = SkillCategoryInfo;
            SkillTabs.DataBind();
            TabIndex1Box.DataSource = SkillCategoryInfo;
            TabIndex1Box.DataBind();
            SkillNote.DataSource = SkillCategoryInfo;
            SkillNote.DataBind();

            string ChannelListAliasD = ConfigurationManager.AppSettings["HomeChannelListD_CategoryAlias"];
            WebModules.HomeChannelListC HomeChannelListC2 = new WebModules.HomeChannelListC(ChannelListAliasD);
            TrainList.DataSource = HomeChannelListC2.CategoryInfo;
            TrainList.DataBind();

            // TEST
            //GridView1.DataSource = HomeChannelListA1.TextInfoL;
            //GridView1.DataBind();
        }
예제 #10
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();
            }
        }
예제 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CacheTest.Text = DateTime.Now.ToString();

            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";

            //图片新闻
            // Text
            string    NewsCommendAlias = ConfigurationManager.AppSettings["NewsCommendAlias"];
            DataTable NewsCommendText  = new DataTable();

            NewsCommendText         = DataQuery.GetSubCategories(NewsCommendAlias);
            FocusTabsTxt.DataSource = NewsCommendText;
            FocusTabsTxt.DataBind();
            //  Pic
            if (NewsCommendText.Rows.Count > 0)
            {
                DataTable NewsCommendPic = new DataTable();
                //NewsCommendPic = new DAL.Article().GetArticleList(NewsCommendText.Rows[0][1].ToString(),false,1); //缓存
                NewsCommendPic = DataQuery.ArticleQuery("", "1", NewsCommendText.Rows[0][2].ToString()).Tables[0];
                if (NewsCommendPic != null)
                {
                    NewsCommendPic.Columns.Add("FocusTabsIndex", typeof(String));
                    NewsCommendPic.Rows[0]["FocusTabsIndex"] = NewsCommendText.Rows[0]["XIndex"];
                    DataTable NewsCommendPicMerge = new DataTable();
                    for (int i = 1; i < NewsCommendText.Rows.Count; i++)
                    {
                        //NewsCommendPicMerge = new DAL.Article().GetArticleList(NewsCommendText.Rows[i][1].ToString(),false,1); //缓存
                        NewsCommendPicMerge = DataQuery.ArticleQuery("", "1", NewsCommendText.Rows[i][2].ToString()).Tables[0];
                        NewsCommendPicMerge.Columns.Add("FocusTabsIndex", typeof(String));
                        NewsCommendPicMerge.Rows[0]["FocusTabsIndex"] = NewsCommendText.Rows[i]["XIndex"];
                        NewsCommendPic.Merge(NewsCommendPicMerge);
                    }
                    FocusTabsPic.DataSource = NewsCommendPic;
                    FocusTabsPic.DataBind();
                }
            }

            //特别关注
            string    SubjectGUID = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["TBGZ_Alias"]);
            string    SubjectPath = DataQuery.CategoryPath(SubjectGUID); //专题路径
            DataTable HotSubjects = new DataTable();

            HotSubjects = DataQuery.GetNHotZT();
            //  获取课件
            //string SubjectHotGUID = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["SAHot_Alias"]);
            // string SubjectHotPath = DataQuery.CategoryPath(SubjectGUID);
            DataTable HotCoursesMerge = new DataTable();

            // 第一个专题
            if (HotSubjects.Rows.Count > 0)
            {
                //string SubjectHotItemPath = SubjectPath + "/" + HotSubjects.Rows[0][0].ToString();
                // DataTable HotCourses = new DAL.CategoryDAL().GetArticleIndexList(SubjectHotItemPath, "最新动态", 2, false);
                string    HotSubjectAlias = DataQuery.CategoryIDToAlias(HotSubjects.Rows[0][0].ToString());
                string    SubjectNewAlias = DataQuery.GetChannelAliasByName(HotSubjectAlias, "最新动态");
                string    SubjectNewGuid  = DataQuery.CategoryAliasToID(SubjectNewAlias);
                DataTable HotCourses      = new DAL.Article().GetArticleList(SubjectNewGuid, false, 2);
                HotCourses.Columns.Add("SubjectID", Type.GetType("System.String"));
                HotCourses.Columns.Add("SubjectTitle", Type.GetType("System.String"));
                for (int i = 0; i < HotCourses.Rows.Count; i++)
                {
                    HotCourses.Rows[i]["SubjectID"]    = HotSubjects.Rows[0][0].ToString();
                    HotCourses.Rows[i]["SubjectTitle"] = HotSubjects.Rows[0][1].ToString();
                }
                //  后N个专题
                for (int i = 1; i < HotSubjects.Rows.Count; i++)
                {
                    //SubjectHotItemPath = SubjectPath + "/" + HotSubjects.Rows[i][0].ToString();
                    //HotCoursesMerge = new DAL.CategoryDAL().GetArticleIndexList(SubjectHotItemPath, "最新动态", 2, false);
                    HotSubjectAlias = DataQuery.CategoryIDToAlias(HotSubjects.Rows[i][0].ToString());
                    SubjectNewGuid  = DataQuery.GetSubChannelGuidByName(HotSubjectAlias, "最新动态");
                    HotCoursesMerge = new DAL.Article().GetArticleList(SubjectNewGuid, false, 2);
                    HotCoursesMerge.Columns.Add("SubjectID", Type.GetType("System.String"));
                    HotCoursesMerge.Columns.Add("SubjectTitle", Type.GetType("System.String"));
                    for (int j = 0; j < HotCoursesMerge.Rows.Count; j++)
                    {
                        HotCoursesMerge.Rows[j]["SubjectID"]    = HotSubjects.Rows[i][0].ToString();
                        HotCoursesMerge.Rows[j]["SubjectTitle"] = HotSubjects.Rows[i][1].ToString();
                    }
                    HotCourses.Merge(HotCoursesMerge);
                }
                SpecialFocusContent.DataSource = HotCourses;
                SpecialFocusContent.DataBind();
            }

            //时事新闻
            DataTable HomeTopDataTable1 = new DataTable();
            string    HomeNews1Guid     = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["HomeTop1Alias"]);

            HomeTopDataTable1 = new DAL.Article().GetArticleList(HomeNews1Guid, true, 1);
            if (HomeTopDataTable1 != null)
            {
                //
                //TopVideoPic1.ImageUrl = DataQuery.GetCoursePicPath(HomeTopDataTable1.Rows[0][0].ToString(), url, "000.jpg");
                TopVideoLink1a.NavigateUrl = "ShowVideo.aspx?ID=" + HomeTopDataTable1.Rows[0][0].ToString();
                TopVideoLink1b.NavigateUrl = "ShowVideo.aspx?ID=" + HomeTopDataTable1.Rows[0][0].ToString();
                string   TopVideoLink1Title = HomeTopDataTable1.Rows[0][1].ToString();
                string[] TopVideoLink1Array = TopVideoLink1Title.Split(new char[] { '[' });
                TopVideoLink1Title  = TopVideoLink1Array[1].Replace("]", "");
                TopVideoLink1b.Text = TopVideoLink1Title;
                TopVideoText1.Text  = DataProcessing.SubstringText(HomeTopDataTable1.Rows[0][10].ToString(), 26);
                //
                DataTable HomeTopDataTable2 = new DataTable();
                string    HomeNews2Guid     = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["HomeTop2Alias"]);
                HomeTopDataTable2 = new DAL.Article().GetArticleList(HomeNews2Guid, false, 1);
                //TopVideoPic2.ImageUrl = DataQuery.GetCoursePicPath(HomeTopDataTable2.Rows[0][0].ToString(), url, "000.jpg");
                TopVideoLink2a.NavigateUrl = "ShowVideo.aspx?ID=" + HomeTopDataTable2.Rows[0][0].ToString();
                TopVideoLink2b.NavigateUrl = "ShowVideo.aspx?ID=" + HomeTopDataTable2.Rows[0][0].ToString();
                string   TopVideoLink2Title = HomeTopDataTable2.Rows[0][1].ToString();
                string[] TopVideoLink2Array = TopVideoLink2Title.Split(new char[] { '[' });
                TopVideoLink2Title  = TopVideoLink2Array[1].Replace("]", "");
                TopVideoLink2b.Text = TopVideoLink2Title;
                string CSVPath = DataQuery.GetFileStreamPath(HomeTopDataTable2.Rows[0][0].ToString(), "vod/data.csv");
                //string CSVPath = DataQuery.GetFileStreamPath(HomeTopDataTable2.Rows[0][0].ToString(), "vod/");
                if (CSVPath != null)
                {
                    DataTable CSVDataSrc = new DataTable();
                    try
                    {
                        CSVDataSrc = DataProcessing.ImportCSV(CSVPath);
                        //CSVDataSrc = DataProcessing.getCsvData(CSVPath, "data.csv");
                        var CSVData = from row in CSVDataSrc.AsEnumerable()
                                      select row;
                        CSVDataSrc = CSVData.Take(1).CopyToDataTable <DataRow>();
                        //DailyVideoInfoTextLines.DataSource = CSVDataSrc;
                        //DailyVideoInfoTextLines.DataBind();
                        string CSVDataText = CSVDataSrc.Rows[0][5].ToString();
                        CSVDataText        = CSVDataText.Remove(0, 1);
                        TopVideoText2.Text = DataProcessing.SubstringText(CSVDataText, 26);
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
            //导航
            string    NaviList1Alias = ConfigurationManager.AppSettings["subject"];
            DataTable NaviList1Items = DataQuery.GetSubCategories(NaviList1Alias, "9");

            NaviList1.DataSource = NaviList1Items;
            NaviList1.DataBind();
            string    NaviList2Alias = ConfigurationManager.AppSettings["MAJOR"];
            DataTable NaviList2Items = DataQuery.GetSubCategories(NaviList2Alias, "9");

            NaviList2.DataSource = NaviList2Items;
            NaviList2.DataBind();
            string    NaviList3Alias = ConfigurationManager.AppSettings["INSTITUTION"];
            DataTable NaviList3Items = DataQuery.GetSubCategories(NaviList3Alias, "9");

            NaviList3.DataSource = NaviList3Items;
            NaviList3.DataBind();
            //主列表
            string ChannelListAliasA1 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_1"];

            WebModules.HomeChannelListA HomeChannelListA1 = new WebModules.HomeChannelListA(ChannelListAliasA1);
            ColumnShowSort1.DataSource = HomeChannelListA1.SubSortTable;
            ColumnShowSort1.DataBind();
            ColumnVideo1.DataSource = HomeChannelListA1.PicInfo;
            ColumnVideo1.DataBind();
            ColumnOtherL1.DataSource = HomeChannelListA1.TextInfoL;
            ColumnOtherL1.DataBind();
            ColumnOtherR1.DataSource = HomeChannelListA1.TextInfoR;
            ColumnOtherR1.DataBind();
            string ChannelListATitle1 = ConfigurationManager.AppSettings["HomeChannelListA_Title_1"];

            ListATitle1.Text       = ChannelListATitle1;
            ListALink1.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA1;

            string ChannelListAliasA2 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_2"];

            WebModules.HomeChannelListA HomeChannelListA2 = new WebModules.HomeChannelListA(ChannelListAliasA2);
            ColumnShowSort2.DataSource = HomeChannelListA2.SubSortTable;
            ColumnShowSort2.DataBind();
            ColumnVideo2.DataSource = HomeChannelListA2.PicInfo;
            ColumnVideo2.DataBind();
            ColumnOtherL2.DataSource = HomeChannelListA2.TextInfoL;
            ColumnOtherL2.DataBind();
            ColumnOtherR2.DataSource = HomeChannelListA2.TextInfoR;
            ColumnOtherR2.DataBind();
            string ChannelListATitle2 = ConfigurationManager.AppSettings["HomeChannelListA_Title_2"];

            ListATitle2.Text       = ChannelListATitle2;
            ListALink2.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA2;

            string ChannelListAliasA3 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_3"];

            WebModules.HomeChannelListA HomeChannelListA3 = new WebModules.HomeChannelListA(ChannelListAliasA3);
            ColumnShowSort3.DataSource = HomeChannelListA3.SubSortTable;
            ColumnShowSort3.DataBind();
            ColumnVideo3.DataSource = HomeChannelListA3.PicInfo;
            ColumnVideo3.DataBind();
            ColumnOtherL3.DataSource = HomeChannelListA3.TextInfoL;
            ColumnOtherL3.DataBind();
            ColumnOtherR3.DataSource = HomeChannelListA3.TextInfoR;
            ColumnOtherR3.DataBind();
            string ChannelListATitle3 = ConfigurationManager.AppSettings["HomeChannelListA_Title_3"];

            ListATitle3.Text       = ChannelListATitle3;
            ListALink3.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA3;

            string ChannelListAliasA4 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_4"];

            WebModules.HomeChannelListA HomeChannelListA4 = new WebModules.HomeChannelListA(ChannelListAliasA4);
            ColumnShowSort4.DataSource = HomeChannelListA4.SubSortTable;
            ColumnShowSort4.DataBind();
            ColumnVideo4.DataSource = HomeChannelListA4.PicInfo;
            ColumnVideo4.DataBind();
            ColumnOtherL4.DataSource = HomeChannelListA4.TextInfoL;
            ColumnOtherL4.DataBind();
            ColumnOtherR4.DataSource = HomeChannelListA4.TextInfoR;
            ColumnOtherR4.DataBind();
            string ChannelListATitle4 = ConfigurationManager.AppSettings["HomeChannelListA_Title_4"];

            ListATitle4.Text       = ChannelListATitle4;
            ListALink4.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA4;

            //右侧列表
            string ChannelListAliasB2 = ConfigurationManager.AppSettings["HomeChannelListB_CategoryAlias_2"];

            WebModules.HomeChannelListB HomeChannelListB2 = new WebModules.HomeChannelListB(ChannelListAliasB2, 1, 8);
            VerticalShowVideo2.DataSource = HomeChannelListB2.PicInfo;
            VerticalShowVideo2.DataBind();
            VerticalShowList2.DataSource = HomeChannelListB2.TextInfo;
            VerticalShowList2.DataBind();
            string ChannelListBTitle2 = ConfigurationManager.AppSettings["HomeChannelListB_Title_2"];

            ListBTitle2.Text       = ChannelListBTitle2;
            ListBLink2.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasB2;

            string ChannelListAliasB3 = ConfigurationManager.AppSettings["HomeChannelListB_CategoryAlias_3"];

            WebModules.HomeChannelListB HomeChannelListB3 = new WebModules.HomeChannelListB(ChannelListAliasB3, 1, 4);
            VerticalShowVideo3.DataSource = HomeChannelListB3.PicInfo;
            VerticalShowVideo3.DataBind();
            VerticalShowList3.DataSource = HomeChannelListB3.TextInfo;
            VerticalShowList3.DataBind();
            string ChannelListBTitle3 = ConfigurationManager.AppSettings["HomeChannelListB_Title_3"];

            ListBTitle3.Text       = ChannelListBTitle3;
            ListBLink3.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasB3;
            //右侧名家
            string ChannelListAliasBS1 = ConfigurationManager.AppSettings["HomeChannelListBS_CategoryAlias_1"];

            WebModules.HomeChannelListBS HomeChannelListBS1 = new WebModules.HomeChannelListBS(ChannelListAliasBS1, 2);
            VerticalShowVideo1.DataSource = HomeChannelListBS1.PicInfo;
            VerticalShowVideo1.DataBind();
            string ChannelListBSTitle1 = ConfigurationManager.AppSettings["HomeChannelListBS_Title_1"];

            ListBTitle1.Text = ChannelListBSTitle1;
            string FameAlias = ConfigurationManager.AppSettings["ChannelFame"];

            ListBLink1.NavigateUrl = "level2.aspx?alias=" + FameAlias;
            //右侧公开课
            string ChannelListAliasBS2 = ConfigurationManager.AppSettings["ChannelClass"];
            //WebModules.HomeChannelListBS HomeChannelListBS2 = new WebModules.HomeChannelListBS(ChannelListAliasBS2, 2);
            //VerticalShowVideo4.DataSource = HomeChannelListBS2.PicInfo;
            //VerticalShowVideo4.DataBind();
            //LeftList
            string    Lv2ClassLeftListAlias  = DataQuery.GetChannelAliasByName(ChannelListAliasBS2, "国内985大学");
            DataTable Lv2ClassLeftList1Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6");

            TabIndex2List1.DataSource = Lv2ClassLeftList1Items;
            TabIndex2List1.DataBind();
            //LeftList
            Lv2ClassLeftListAlias = DataQuery.GetChannelAliasByName(ChannelListAliasBS2, "国外大学");
            DataTable Lv2ClassLeftList2Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6");

            TabIndex2List2.DataSource = Lv2ClassLeftList2Items;
            TabIndex2List2.DataBind();

            //下方列表
            string    SkillListAlias    = ConfigurationManager.AppSettings["HomeChannelListC_CategoryAlias"];
            DataTable SkillCategoryInfo = DataQuery.GetSubCategoriesNote(DataQuery.GetChannelAliasByName(SkillListAlias, "栏目"), "8");

            SkillTabs.DataSource = SkillCategoryInfo;
            SkillTabs.DataBind();
            TabIndex1Box.DataSource = SkillCategoryInfo;
            TabIndex1Box.DataBind();
            SkillNote.DataSource = SkillCategoryInfo;
            SkillNote.DataBind();

            string ChannelListAliasD = ConfigurationManager.AppSettings["HomeChannelListD_CategoryAlias"];

            WebModules.HomeChannelListC HomeChannelListC2 = new WebModules.HomeChannelListC(ChannelListAliasD);
            TrainList.DataSource = HomeChannelListC2.CategoryInfo;
            TrainList.DataBind();

            // TEST
            //GridView1.DataSource = HomeChannelListA1.TextInfoL;
            //GridView1.DataBind();
        }
예제 #12
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            url          = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            ChannelAlias = ConfigurationManager.AppSettings["ChannelClass"];
            string ChannelTitle = "名校公开课";

            // 痕迹&栏目标题
            CurrentTrace.Text        = ChannelTitle;
            CurrentCategoryName.Text = ChannelTitle;
            TraceLv2Link.NavigateUrl = "Level2Class.aspx";
            //1

            //2
            Lv3NaviAlias1 = DataQuery.GetChannelAliasByName(ChannelAlias, "国内985大学");
            DataTable Lv3Navi2Items = DataQuery.GetSubCategories(Lv3NaviAlias1);

            Lv3Navi2.DataSource = Lv3Navi2Items;
            Lv3Navi2.DataBind();
            //2a
            Lv3NaviAlias1a = DataQuery.GetChannelAliasByName(ChannelAlias, "国内211大学");
            DataTable Lv3Navi2aItems = DataQuery.GetSubCategories(Lv3NaviAlias1a);

            Lv3Navi2a.DataSource = Lv3Navi2aItems;
            Lv3Navi2a.DataBind();
            //2b
            Lv3NaviAlias1b = DataQuery.GetChannelAliasByName(ChannelAlias, "国内其他大学");
            DataTable Lv3Navi2bItems = DataQuery.GetSubCategories(Lv3NaviAlias1b);

            Lv3Navi2b.DataSource = Lv3Navi2bItems;
            Lv3Navi2b.DataBind();
            //3
            Lv3NaviAlias2 = DataQuery.GetChannelAliasByName(ChannelAlias, "国外大学");
            DataTable Lv3Navi3Items = DataQuery.GetSubCategories(Lv3NaviAlias2);

            Lv3Navi3.DataSource = Lv3Navi3Items;
            Lv3Navi3.DataBind();
            //
            SetAliasAndIsChild();
            string CategoryGUID = DataQuery.CategoryAliasToID(alias);
            string CategoryPath = DataQuery.CategoryPath(CategoryGUID);

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

            if (Lv2Alias == "gxb2_openclass_3")
            {
                Lv2CategoriesIndex = 0;
            }
            else if (Lv2Alias == Lv3NaviAlias1)
            {
                Lv2CategoriesIndex = 1;
            }
            else if (Lv2Alias == Lv3NaviAlias1a)
            {
                Lv2CategoriesIndex = 2;
            }
            else if (Lv2Alias == Lv3NaviAlias1b)
            {
                Lv2CategoriesIndex = 3;
            }
            else if (Lv2Alias == Lv3NaviAlias2)
            {
                Lv2CategoriesIndex = 4;
            }
            else
            {
                Lv2CategoriesIndex = 0;
            }
            //主列表
            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;
                }
            }
        }
예제 #13
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            url          = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            ChannelAlias = ConfigurationManager.AppSettings["ChannelFame"];
            string ChannelTitle = "名家";
            // 痕迹&栏目标题

            //音序索引
            string    Lv3InitialAlias     = DataQuery.GetChannelAliasByName(ChannelAlias, "音序索引");
            DataTable Lv3InitialListItems = DataQuery.GetSubCategories(Lv3InitialAlias);

            Lv3InitialList.DataSource = Lv3InitialListItems;
            Lv3InitialList.DataBind();
            //机构索引
            //string Lv3OrgAlias = DataQuery.GetChannelAliasByName(ChannelAlias, "机构索引");
            //DataTable Lv3OrgListItems = DataQuery.GetSubCategories(Lv3OrgAlias);
            //Lv3OrgList.DataSource = Lv3OrgListItems;
            //Lv3OrgList.DataBind();
            //嘉宾名录
            string    Lv3NameAlias     = DataQuery.GetChannelAliasByName(ChannelAlias, "专家名录");
            DataTable Lv3NameListItems = DataQuery.GetSubCategories(Lv3NameAlias);

            Lv3NameList.DataSource = Lv3NameListItems;
            Lv3NameList.DataBind();
            //折叠菜单状态
            SetAliasAndIsChild();
            string CategoryGUID = DataQuery.CategoryAliasToID(alias);
            string CategoryPath = DataQuery.CategoryPath(CategoryGUID);

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

            if (Lv2Alias == Lv3InitialAlias)
            {
                Lv2CategoriesIndex = 0;
            }
            //else if (Lv2Alias == Lv3OrgAlias) Lv2CategoriesIndex = 1;
            else if (Lv2Alias == Lv3NameAlias)
            {
                Lv2CategoriesIndex = 2;
            }
            else
            {
                Lv2CategoriesIndex = 0;
            }
            //主列表
            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;
                }
            }
        }
예제 #14
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;
        }