Ejemplo n.º 1
0
        /// <summary>
        /// 二级分类排序
        /// </summary>
        /// <param name="productClassDic"></param>
        /// <returns></returns>
        protected Dictionary <string, string> productClassSort(Dictionary <string, string> productClassDic)
        {
            List <ProductClassInfo>     classList           = new List <ProductClassInfo>();
            Dictionary <string, string> sortProductClassDic = new Dictionary <string, string>();

            foreach (string key in productClassDic.Keys)
            {
                classList.Add(ProductClassBLL.ReadProductClassCache(int.Parse(key)));
            }

            classList.Sort(SortCompare);

            for (int i = 0; i < classList.Count; i++)
            {
                sortProductClassDic.Add(classList[i].ID.ToString(), productClassDic[classList[i].ID.ToString()]);
            }

            return(sortProductClassDic);
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         this.FatherID.DataSource     = ProductClassBLL.ReadProductClassNamedList();
         this.FatherID.DataTextField  = "ClassName";
         this.FatherID.DataValueField = "ID";
         this.FatherID.DataBind();
         this.FatherID.Items.Insert(0, new ListItem("作为最大类", "0"));
         int queryString = RequestHelper.GetQueryString <int>("ID");
         if (queryString != -2147483648)
         {
             base.CheckAdminPower("ReadProductClass", PowerCheckType.Single);
             ProductClassInfo info = ProductClassBLL.ReadProductClassCache(queryString);
             this.FatherID.Text    = info.FatherID.ToString();
             this.OrderID.Text     = info.OrderID.ToString();
             this.ClassName.Text   = info.ClassName;
             this.Keywords.Text    = info.Keywords;
             this.Description.Text = info.Description;
             this.IsDownload.Text  = info.IsDownload.ToString();
         }
     }
 }
Ejemplo n.º 3
0
        private PostCateInfo GetPostClassList()
        {
            string QuestType   = RequestHelper.GetForm <string>("questType");
            int    classID     = RequestHelper.GetForm <int>("ClassID");
            int    studyPostID = int.Parse(CookiesHelper.ReadCookieValue("UserStudyPostId"));
            Dictionary <string, Dictionary <string, string> > postProductClassList = new Dictionary <string, Dictionary <string, string> >();

            string postCourseID     = PostBLL.ReadPostCourseID(base.UserCompanyID, studyPostID);
            string passPostCourseID = string.IsNullOrEmpty(postCourseID) ? "" : TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, postCourseID, 1));

            postCourseID = StringHelper.SubString(postCourseID, passPostCourseID);

            //加载认证考试
            PostPassInfo passpost = new PostPassInfo();

            passpost.UserId = base.UserID;
            passpost.IsRZ   = 0;

            RenZhengCateInfo rzCate = new RenZhengCateInfo();

            rzCate.InPostID = PostPassBLL.PassPostString(passpost);
            string rzProductID = RenZhengCateBLL.ReadTestCateID(rzCate);

            postCourseID = string.IsNullOrEmpty(rzProductID) ? postCourseID : string.IsNullOrEmpty(postCourseID) ? rzProductID : postCourseID + "," + rzProductID;

            //加载大课件
            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.IsSale  = 1;
            productSearch.ClassID = "|5298|";
            List <ProductInfo> dkjProductList = ProductBLL.SearchProductList(productSearch);

            if (dkjProductList.Count > 0)
            {
                string dkjCourseID = ProductBLL.ReadProductIdStr(dkjProductList);
                postCourseID = string.IsNullOrEmpty(postCourseID) ? dkjCourseID : postCourseID + "," + dkjCourseID;
            }

            if (!string.IsNullOrEmpty(postCourseID))
            {
                postProductClassList = ProductClassBLL.ReadProductClassListByProductID(postCourseID, 1);
            }
            if (postProductClassList.Count > 1)
            {
                postProductClassList = ProductClassBLL.productClassSort(postProductClassList);
            }

            List <Dictionary <string, string> > productClassList = new List <Dictionary <string, string> >();

            foreach (string key in postProductClassList.Keys)
            {
                Dictionary <string, string> productClassDic = new Dictionary <string, string>();
                productClassDic.Add("ID", key);
                productClassDic.Add("Name", ProductClassBLL.ReadProductClassCache(int.Parse(key)).ClassName);
                productClassList.Add(productClassDic);
            }

            PostCateInfo studyPost = new PostCateInfo();

            studyPost.EncryptFcateID       = studyPostID.ToString();
            studyPost.Title                = PostBLL.ReadPost(studyPostID).PostName;
            studyPost.ChildCourseFCateView = productClassList;

            return(studyPost);

            //三个岗位加载 竞品选修
            //if (StringHelper.CompareSingleString("4,5,64", studyPostID.ToString()))
            //{
            //    ProductSearchInfo productSearch = new ProductSearchInfo();
            //    productSearch.ClassID = "|6|";
            //    productSearch.InBrandID = base.CompanyBrandID;
            //    productSearch.IsSale = 1;
            //    productSearch.NotLikeName = "必修";
            //    string xxCourseID = ProductBLL.ReadProductIdStr(ProductBLL.SearchProductList(productSearch));
            //    string passXXCourseID = TestPaperBLL.ReadCourseIDStr(TestPaperBLL.ReadList(base.UserID, xxCourseID, 1));
            //    //if (passType == 1)
            //    //    xxCourseID = passXXCourseID;
            //    //else if (passType == 0)
            //    xxCourseID = StringHelper.SubString(xxCourseID, passXXCourseID);
            //    if (!string.IsNullOrEmpty(xxCourseID))
            //        this.xxProductClassList = ProductClassBLL.ReadProductClassListByProductID(xxCourseID, 1);
            //}

            //if (!string.IsNullOrEmpty(QuestType))
            //{
            //    List<PostInfo> PostCateList = new List<PostInfo>();
            //    PostCateList.Add(PostBLL.ReadPost(PostId));
            //    return ConvertToPostCate(PostCateList, true);
            //}
            //else
            //{
            //    return ConvertToPostCate(PostBLL.ReadPostCateRootList(), true);
            //}
        }
Ejemplo n.º 4
0
        protected void SearchCondition()
        {
            string keyword = RequestHelper.GetQueryString <string>("Keyword");
            string tags    = RequestHelper.GetQueryString <string>("Tags");

            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.IsSale    = 1;
            productSearch.IsSpecial = 1;

            if (!string.IsNullOrEmpty(brandID))
            {
                List <ProductBrandInfo> productBrandList = ProductBrandBLL.ReadProductBrandCacheList(brandID);
                foreach (ProductBrandInfo info in productBrandList)
                {
                    showCondition += ShowCondition("BrandID", info.Name);
                }
                productSearch.InBrandID = brandID;
            }

            if (postID > 0)
            {
                PostInfo studyPost = PostBLL.ReadPost(postID);
                showCondition            += ShowCondition("PostID", studyPost.PostName);
                productSearch.InProductID = studyPost.PostPlan;
            }

            if (classID > 0)
            {
                ProductClassInfo productClass = ProductClassBLL.ReadProductClassCache(classID);
                showCondition        += ShowCondition("ClassID", productClass.ClassName);
                productSearch.ClassID = "|" + classID.ToString() + "|";
            }

            if (keyword != string.Empty)
            {
                showCondition    += "“" + keyword + "”";
                productSearch.Key = keyword;
            }

            productSearchList = ProductBLL.SearchProductList(base.CurrentPage, 15, productSearch, ref Count);
            this.commonPagerClass.CurrentPage = base.CurrentPage;
            this.commonPagerClass.PageSize    = 15;
            this.commonPagerClass.Count       = Count;

            if (string.IsNullOrEmpty(showCondition))
            {
                showCondition = "<li class=\"select-no\">您暂无选择筛选条件<span class=\"count-result\">共<span style=\"margin:0 4px;\">" + base.Count.ToString() + "</span>个结果</span></li>";
            }

            //this.searchCondition = "ClassID=" + classID.ToString() + "&ProductName=" + keyword + "&BrandID=" + brandID.ToString() + "&Tags=" + tags;
            //if (classID > 0)
            //{
            //    ProductClassInfo info = ProductClassBLL.ReadProductClassCache(classID);
            //    this.showCondition = "分类:<span>" + info.ClassName + "</span>";
            //    this.showTitle = info.ClassName;
            //    //showDescription = info.Description;
            //    this.searchType = 2;
            //    int iD = info.ID;
            //    if (ProductClassBLL.ReadProductClassChildList(info.ID).Count == 0)
            //    {
            //        iD = info.FatherID;
            //    }
            //    foreach (ProductClassInfo info2 in ProductClassBLL.ReadProductClassChildList(iD))
            //    {
            //        this.relationSearch = string.Concat(new object[] { relationSearch, "<a href=\"/Product-C", info2.ID, ".aspx\">", info2.ClassName, "</a>" });
            //    }
            //}
            //if (brandID > 0)
            //{
            //    ProductBrandInfo Info = ProductBrandBLL.ReadProductBrandCache(brandID);
            //    this.showCondition = "品牌:<span>" + Info.Name + "</span>";
            //    this.showTitle = Info.Name;
            //    //showDescription = Info.Description;
            //    this.searchType = 2;
            //    foreach (ProductBrandInfo info3 in base.topProductBrandList)
            //    {
            //        this.relationSearch = string.Concat(new object[] { relationSearch, "<a href=\"/Product-B", info3.ID, ".aspx\">", info3.Name, "</a>" });
            //    }
            //}
            //if (tags != string.Empty)
            //{
            //    this.showCondition = "标签:<span>" + tags + "</span>";
            //    this.showTitle = tags;
            //    this.searchType = 2;
            //    foreach (TagsInfo info4 in base.tagsList)
            //    {
            //        this.relationSearch = this.relationSearch + "<a href=\"/Product/Tags/" + base.Server.UrlEncode(info4.Word) + ".aspx\"  style=\"font-size:" + info4.Size.ToString() + "px; color:" + info4.Color + "\">" + info4.Word + "</a>";
            //    }
            //}
            //if (RequestHelper.GetQueryString<int>("IsNew") == 1)
            //{
            //    this.showCondition = "新品上市";
            //    this.showTitle = "新品上市";
            //    this.searchCondition = "IsNew=1";
            //}
            //if (RequestHelper.GetQueryString<int>("IsHot") == 1)
            //{
            //    this.showCondition = "热销商品";
            //    this.showTitle = "热销商品";
            //    this.searchCondition = "IsHot=1";
            //}
            //if (RequestHelper.GetQueryString<int>("IsSpecial") == 1)
            //{
            //    this.showCondition = "特价商品";
            //    this.showTitle = "特价商品";
            //    this.searchCondition = "IsSpecial=1";
            //}
            //if (RequestHelper.GetQueryString<int>("IsTop") == 1)
            //{
            //    this.showCondition = "推荐商品";
            //    this.showTitle = "推荐商品";
            //    this.searchCondition = "IsTop=1";
            //}
            //if (keyword != string.Empty)
            //{
            //    this.showCondition = this.showCondition + "关键字:<span>" + keyword + "</span>";
            //    this.showTitle = this.showTitle + keyword;
            //    this.searchType = 2;
            //    foreach (string str3 in ShopConfig.ReadConfigInfo().HotKeyword.Split(new char[] { ',' }))
            //    {
            //        this.relationSearch = this.relationSearch + "<a href=\"/Product/Keyword/" + base.Server.UrlEncode(str3) + ".aspx\">" + str3 + "</a>";
            //    }
            //}
            //if (this.searchType == 1)
            //{
            //    if (this.showCondition != string.Empty)
            //    {
            //        this.showCondition = "首页 > " + this.showCondition;
            //    }
            //    else
            //    {
            //        this.showCondition = "首页 > 全部商品";
            //        this.showTitle = "全部商品";
            //    }
            //}
            //else
            //{
            //    this.showCondition = "您搜索的" + this.showCondition;
            //}
            base.Title = this.showTitle + " - 商品展示";
        }