/// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int id = RequestHelper.GetQueryString <int>("ID");

            themeActivity = ThemeActivityBLL.ReadThemeActivity(id);
            styleArray    = themeActivity.Style.Split('|');
            if (themeActivity.ProductGroup != string.Empty)
            {
                string productIDList = string.Empty;
                productGroupArray = themeActivity.ProductGroup.Split('#');
                for (int i = 0; i < productGroupArray.Length; i++)
                {
                    if (productGroupArray[i].Split('|')[2] != string.Empty)
                    {
                        if (productIDList == string.Empty)
                        {
                            productIDList = productGroupArray[i].Split('|')[2];
                        }
                        else
                        {
                            productIDList += "," + productGroupArray[i].Split('|')[2];
                        }
                    }
                }
                if (productIDList != string.Empty)
                {
                    ProductSearchInfo productSearch = new ProductSearchInfo();
                    productSearch.InProductID = productIDList;
                    productList     = ProductBLL.SearchProductList(productSearch);
                    memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(productIDList, base.GradeID);
                }
            }
            Title = themeActivity.Name;
        }
Example #2
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int id = RequestHelper.GetQueryString <int>("ID");

            productBrand = ProductBrandBLL.ReadProductBrandCache(id);

            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.BrandID = id;
            productSearch.IsTop   = (int)BoolType.True;
            productList           = ProductBLL.SearchProductList(productSearch);

            string strProductID = string.Empty;

            foreach (ProductInfo product in productList)
            {
                if (strProductID == string.Empty)
                {
                    strProductID = product.ID.ToString();
                }
                else
                {
                    strProductID += "," + product.ID.ToString();
                }
            }
            if (strProductID != string.Empty)
            {
                memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
            }

            Title = productBrand.Name;
        }
Example #3
0
        protected override void PageLoad()
        {
            base.PageLoad();
            int queryString = RequestHelper.GetQueryString <int>("ID");

            this.themeActivity = ThemeActivityBLL.ReadThemeActivity(queryString);
            this.styleArray    = this.themeActivity.Style.Split(new char[] { '|' });
            if (this.themeActivity.ProductGroup != string.Empty)
            {
                string strProductID = string.Empty;
                this.productGroupArray = this.themeActivity.ProductGroup.Split(new char[] { '#' });
                for (int i = 0; i < this.productGroupArray.Length; i++)
                {
                    if (this.productGroupArray[i].Split(new char[] { '|' })[2] != string.Empty)
                    {
                        if (strProductID == string.Empty)
                        {
                            strProductID = this.productGroupArray[i].Split(new char[] { '|' })[2];
                        }
                        else
                        {
                            strProductID = strProductID + "," + this.productGroupArray[i].Split(new char[] { '|' })[2];
                        }
                    }
                }
                if (strProductID != string.Empty)
                {
                    ProductSearchInfo productSearch = new ProductSearchInfo();
                    productSearch.InProductID = strProductID;
                    this.productList          = ProductBLL.SearchProductList(productSearch);
                    this.memberPriceList      = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
                }
            }
            base.Title = this.themeActivity.Name;
        }
Example #4
0
        protected override void PageLoad()
        {
            base.PageLoad();
            string queryString = RequestHelper.GetQueryString <string>("ID");
            //this.productBrand = ProductBrandBLL.ReadProductBrandCache(queryString);
            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.InBrandID = queryString;
            productSearch.IsTop     = 1;
            this.productList        = ProductBLL.SearchProductList(productSearch);
            string strProductID = string.Empty;

            foreach (ProductInfo info2 in this.productList)
            {
                if (strProductID == string.Empty)
                {
                    strProductID = info2.ID.ToString();
                }
                else
                {
                    strProductID = strProductID + "," + info2.ID.ToString();
                }
            }
            if (strProductID != string.Empty)
            {
                this.memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
            }
            base.Title = this.productBrand.Name;
        }
Example #5
0
 protected override void PageLoad()
 {
     base.PageLoad();
     int queryString = RequestHelper.GetQueryString<int>("CommentID");
     this.productComment = ProductCommentBLL.ReadProductComment(queryString, 0);
     this.product = ProductBLL.ReadProduct(this.productComment.ProductID);
     int count = -2147483648;
     int currentPage = 1;
     int pageSize = 5;
     ProductCommentSearchInfo productComment = new ProductCommentSearchInfo();
     productComment.ProductID = this.product.ID;
     this.productCommentList = ProductCommentBLL.SearchProductCommentList(currentPage, pageSize, productComment, ref count);
     string strProductID = base.Server.UrlDecode(CookiesHelper.ReadCookieValue("HistoryProduct"));
     if (strProductID != string.Empty)
     {
         ProductSearchInfo productSearch = new ProductSearchInfo();
         productSearch.InProductID = strProductID;
         this.tempProductList = ProductBLL.SearchProductList(productSearch);
         this.tempMemberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
     }
 }
Example #6
0
        protected override void PageLoad()
        {
            base.PageLoad();
            int queryString = RequestHelper.GetQueryString <int>("ID");

            this.product = ProductBLL.ReadProduct(queryString);
            if (this.product.IsSale == 0)
            {
                ScriptHelper.Alert("该产品未上市,不能查看");
            }
            ProductBLL.ChangeProductViewCount(queryString, 1);
            this.userGradeList      = UserGradeBLL.ReadUserGradeCacheList();
            this.memberPriceList    = MemberPriceBLL.ReadMemberPriceByProduct(queryString);
            this.currentMemberPrice = (this.product.MarketPrice * UserGradeBLL.ReadUserGradeCache(base.GradeID).Discount) / 100M;
            foreach (MemberPriceInfo info in this.memberPriceList)
            {
                if (info.GradeID == base.GradeID)
                {
                    this.currentMemberPrice = info.Price;
                    break;
                }
            }
            this.currentMemberPrice = Math.Round(this.currentMemberPrice, 2);
            ProductPhotoInfo item = new ProductPhotoInfo();

            item.Name  = this.product.Name;
            item.Photo = this.product.Photo;
            this.productPhotoList.Add(item);
            this.productPhotoList.AddRange(ProductPhotoBLL.ReadProductPhotoByProduct(queryString));
            this.strHistoryProduct = base.Server.UrlDecode(CookiesHelper.ReadCookieValue("HistoryProduct"));
            string strProductID = (this.product.RelationProduct + "," + this.product.Accessory + "," + this.strHistoryProduct).Replace(",,", ",");

            if (strProductID.StartsWith(","))
            {
                strProductID = strProductID.Substring(1);
            }
            if (strProductID.EndsWith(","))
            {
                strProductID = strProductID.Substring(0, strProductID.Length - 1);
            }
            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.InProductID = strProductID;
            this.tempProductList      = ProductBLL.SearchProductList(productSearch);
            if (strProductID != string.Empty)
            {
                this.tempMemberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
            }
            this.attributeRecordList = AttributeRecordBLL.ReadAttributeRecordByProduct(queryString);
            TagsSearchInfo tags = new TagsSearchInfo();

            tags.ProductID       = queryString;
            this.productTagsList = TagsBLL.SearchTagsList(tags);
            if (this.product.RelationArticle != string.Empty)
            {
                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.InArticleID = this.product.RelationArticle;
                this.productArticleList   = ArticleBLL.SearchArticleList(articleSearch);
            }
            this.standardRecordList = StandardRecordBLL.ReadStandardRecordByProduct(this.product.ID, this.product.StandardType);
            if ((this.standardRecordList.Count > 0) && (this.product.StandardType == 1))
            {
                string[] strArray = this.standardRecordList[0].StandardIDList.Split(new char[] { ',' });
                for (int i = 0; i < strArray.Length; i++)
                {
                    StandardInfo info6     = StandardBLL.ReadStandardCache(Convert.ToInt32(strArray[i]));
                    string[]     strArray2 = info6.ValueList.Split(new char[] { ',' });
                    string[]     strArray3 = info6.PhotoList.Split(new char[] { ',' });
                    string       str2      = string.Empty;
                    string       str3      = string.Empty;
                    for (int j = 0; j < strArray2.Length; j++)
                    {
                        foreach (StandardRecordInfo info7 in this.standardRecordList)
                        {
                            string[] strArray4 = info7.ValueList.Split(new char[] { ',' });
                            if (strArray2[j] == strArray4[i])
                            {
                                str2 = str2 + strArray2[j] + ",";
                                str3 = str3 + strArray3[j] + ",";
                                goto Label_043B;
                            }
                        }
                        Label_043B :;
                    }
                    if (str2 != string.Empty)
                    {
                        str2 = str2.Substring(0, str2.Length - 1);
                        str3 = str3.Substring(0, str3.Length - 1);
                    }
                    info6.ValueList = str2;
                    info6.PhotoList = str3;
                    this.standardList.Add(info6);
                }
                foreach (StandardRecordInfo info7 in this.standardRecordList)
                {
                    object standardRecordValueList = this.standardRecordValueList;
                    this.standardRecordValueList = string.Concat(new object[] { standardRecordValueList, info7.ProductID, ",", info7.ValueList, "|" });
                }
            }
            if (ShopConfig.ReadConfigInfo().ProductStorageType == 1)
            {
                this.leftStorageCount = this.product.TotalStorageCount - this.product.OrderCount;
            }
            else
            {
                this.leftStorageCount = this.product.ImportVirtualStorageCount;
            }
            base.Title       = this.product.Name;
            base.Keywords    = (this.product.Keywords == string.Empty) ? this.product.Name : this.product.Keywords;
            base.Description = (this.product.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(this.product.Introduction), 200) : this.product.Summary;
        }
Example #7
0
        private void ReadCart()
        {
            this.cartList = CartBLL.ReadCartList(base.UserID);
            string strProductID = string.Empty;

            foreach (CartInfo info in this.cartList)
            {
                if (strProductID == string.Empty)
                {
                    strProductID = info.ProductID.ToString();
                }
                else
                {
                    strProductID = strProductID + "," + info.ProductID.ToString();
                }
            }
            if (strProductID != string.Empty)
            {
                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.InProductID = strProductID;
                this.productList          = ProductBLL.SearchProductList(productSearch);
            }
            List <MemberPriceInfo> memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);

            foreach (CartInfo info in this.cartList)
            {
                ProductInfo product = ProductBLL.ReadProductByProductList(this.productList, info.ProductID);
                info.ProductWeight = product.Weight;
                info.SendPoint     = product.SendPoint;
                if (ShopConfig.ReadConfigInfo().ProductStorageType == 1)
                {
                    info.LeftStorageCount = product.TotalStorageCount - product.OrderCount;
                }
                else
                {
                    info.LeftStorageCount = product.ImportVirtualStorageCount;
                }
                info.ProductPrice = MemberPriceBLL.ReadCurrentMemberPrice(memberPriceList, base.GradeID, product);
            }
            CartBLL.HandlerCartList(this.cartList, ref this.cartGiftPackVirtualList, ref this.cartCommonProductVirtualList);
            int     num  = 0;
            decimal num2 = 0M;
            decimal num3 = 0M;

            foreach (CartGiftPackVirtualInfo info4 in this.cartGiftPackVirtualList)
            {
                num3 += info4.TotalProductWeight * info4.GiftPackBuyCount;
                num2 += info4.TotalPrice * info4.GiftPackBuyCount;
            }
            foreach (CartCommonProductVirtualInfo info5 in this.cartCommonProductVirtualList)
            {
                num3 += info5.FatherCart.ProductWeight * info5.FatherCart.BuyCount;
                num2 += info5.FatherCart.ProductPrice * info5.FatherCart.BuyCount;
            }
            foreach (CartInfo info in this.cartList)
            {
                if (info.FatherID == 0)
                {
                    num += info.BuyCount;
                }
            }
            Sessions.ProductBuyCount    = num;
            Sessions.ProductTotalPrice  = num2;
            Sessions.ProductTotalWeight = num3;
        }
Example #8
0
        protected void AddOrderProduct(int orderID)
        {
            List <CartInfo> list         = CartBLL.ReadCartList(base.UserID);
            string          strProductID = string.Empty;

            foreach (CartInfo info in list)
            {
                if (strProductID == string.Empty)
                {
                    strProductID = info.ProductID.ToString();
                }
                else
                {
                    strProductID = strProductID + "," + info.ProductID.ToString();
                }
            }
            List <ProductInfo> productList = new List <ProductInfo>();

            if (strProductID != string.Empty)
            {
                ProductSearchInfo productSearch = new ProductSearchInfo();
                productSearch.InProductID = strProductID;
                productList = ProductBLL.SearchProductList(productSearch);
            }
            List <MemberPriceInfo>    memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
            Dictionary <string, bool> dictionary      = new Dictionary <string, bool>();
            Dictionary <int, int>     dictionary2     = new Dictionary <int, int>();

            foreach (CartInfo info in list)
            {
                ProductInfo     product     = ProductBLL.ReadProductByProductList(productList, info.ProductID);
                OrderDetailInfo orderDetail = new OrderDetailInfo();
                orderDetail.OrderID       = orderID;
                orderDetail.ProductID     = info.ProductID;
                orderDetail.ProductName   = info.ProductName;
                orderDetail.ProductWeight = product.Weight;
                orderDetail.SendPoint     = product.SendPoint;
                if (info.GiftPackID == 0)
                {
                    orderDetail.ProductPrice = MemberPriceBLL.ReadCurrentMemberPrice(memberPriceList, base.GradeID, product);
                }
                else if (dictionary.ContainsKey(info.RandNumber + "|" + info.GiftPackID.ToString()))
                {
                    orderDetail.ProductPrice = 0M;
                }
                else
                {
                    orderDetail.ProductPrice = GiftPackBLL.ReadGiftPack(info.GiftPackID).Price;
                    dictionary.Add(info.RandNumber + "|" + info.GiftPackID.ToString(), true);
                }
                orderDetail.BuyCount = info.BuyCount;
                if (info.FatherID > 0)
                {
                    orderDetail.FatherID = dictionary2[info.FatherID];
                }
                orderDetail.RandNumber = info.RandNumber;
                orderDetail.GiftPackID = info.GiftPackID;
                int num = OrderDetailBLL.AddOrderDetail(orderDetail);
                dictionary2.Add(info.ID, num);
            }
            CartBLL.ClearCart(base.UserID);
            Sessions.ProductTotalPrice  = 0M;
            Sessions.ProductBuyCount    = 0;
            Sessions.ProductTotalWeight = 0M;
        }
Example #9
0
        protected override void PageLoad()
        {
            base.PageLoad();
            if (CookiesHelper.ReadCookieValue("ProductShowWay") != string.Empty)
            {
                this.productShowWay = Convert.ToInt32(CookiesHelper.ReadCookieValue("ProductShowWay"));
            }
            int queryString = RequestHelper.GetQueryString <int>("Page");

            if (queryString < 1)
            {
                queryString = 1;
            }
            int pageSize = 20;

            if (this.productShowWay == 2)
            {
                pageSize = 10;
            }
            int count = 0;
            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.IsSale           = 1;
            productSearch.ProductOrderType = CookiesHelper.ReadCookieValue("ProductOrderType");
            if (RequestHelper.GetQueryString <int>("SearchType") == 2)
            {
                string str  = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("ClassID"));
                int    num5 = -2147483648;
                if (str == num5.ToString())
                {
                    str = string.Empty;
                }
                else
                {
                    str = "|" + str + "|";
                }
                productSearch.ClassID   = str;
                productSearch.Key       = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("ProductName"));
                productSearch.InBrandID = RequestHelper.GetQueryString <string>("BrandID");
                productSearch.Tags      = StringHelper.SearchSafe(RequestHelper.GetQueryString <string>("Tags"));
            }
            else
            {
                productSearch.IsNew     = RequestHelper.GetQueryString <int>("IsNew");
                productSearch.IsHot     = RequestHelper.GetQueryString <int>("IsHot");
                productSearch.IsSpecial = RequestHelper.GetQueryString <int>("IsSpecial");
                productSearch.IsTop     = RequestHelper.GetQueryString <int>("IsTop");
            }
            if ((productSearch.ProductOrderType == "MemberPrice1") || (productSearch.ProductOrderType == "MemberPrice2"))
            {
                UserGradeInfo info2 = UserGradeBLL.ReadUserGradeCache(base.GradeID);
                if (productSearch.ProductOrderType == "MemberPrice2")
                {
                    productSearch.OrderType = OrderType.Asc;
                }
                this.productList = ProductBLL.SearchProductList(queryString, pageSize, productSearch, ref count, info2.ID, info2.Discount / 100M);
            }
            else
            {
                this.productList      = ProductBLL.SearchProductList(queryString, pageSize, productSearch, ref count);
                this.countPriceSingle = true;
                string strProductID = string.Empty;
                foreach (ProductInfo info3 in this.productList)
                {
                    if (strProductID == string.Empty)
                    {
                        strProductID = info3.ID.ToString();
                    }
                    else
                    {
                        strProductID = strProductID + "," + info3.ID.ToString();
                    }
                }
                if (strProductID != string.Empty)
                {
                    this.memberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID);
                }
            }
            this.ajaxPagerClass.CurrentPage = queryString;
            this.ajaxPagerClass.PageSize    = pageSize;
            this.ajaxPagerClass.Count       = count;
        }