示例#1
0
        public void MainPicListDataBind(string guid, bool NeedSummary, string ListOrder, bool HasChildCategory)
        {
            int CurrentPage;

            CurrentPage = Lv3Pager.CurrentPageIndex;
            Level3MainListPic.DataSource = new DAL.Article().GetArticleList(guid, NeedSummary, ListOrder, CurrentPage, HasChildCategory, out RecordCount);
            Level3MainListPic.DataBind();
        }
示例#2
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;
                }
            }
        }
示例#3
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();
        }
示例#4
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;
                }
            }
        }
示例#5
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;
                }
            }
        }