Esempio n. 1
0
        /// <summary>
        /// 显示规格列表头部
        /// </summary>
        /// <param name="attribute"></param>
        /// <returns></returns>
        protected string ShowStandardHead(ProductTypeStandardRecordInfo standardInfo, int pType)
        {
            string[] valArr  = standardInfo.StandardIdList.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            string   headStr = "<thead><tr>";

            foreach (string valstr in valArr)
            {
                if (!string.IsNullOrEmpty(valstr))
                {
                    headStr += "<td>" + ProductTypeStandardBLL.Read(Convert.ToInt32(valstr)).Name + "</td>";
                }
            }
            if (pType == 1)
            {
                headStr += "<td width=\"10%\"><input type=\"hidden\" name=\"StandardIDList\" id=\"StandardIDList\" value=\"" + standardInfo.StandardIdList + ";\"> <span class=\"red\">*</span>本站价</td><td width=\"10%\"><span class=\"red\">*</span>市场价</td><td width=\"10%\"><span class=\"red\">*</span>团购价</td><td width=\"10%\"><span class=\"red\">*</span>库存</td><td width=\"15%\" height=\"40\">货号</td><td>图片</td></tr></thead>";
            }
            else
            {
                headStr += "<td width=\"55%\"><input type=\"hidden\" name=\"StandardIDList\" id=\"StandardIDList\" value=\"" + standardInfo.StandardIdList + ";\"> 关联产品</td></tr></thead>";
            }
            return(headStr);
        }
        /// <summary>
        /// 提交按钮点击方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            #region
            //添加属性组,即产品类型
            int             productTypeID = 0;
            ProductTypeInfo productType   = new ProductTypeInfo();
            productType.Id   = RequestHelper.GetQueryString <int>("ID");
            productType.Name = Name.Text;
            //productType.BrandIds = RequestHelper.GetForm<string>("proBrand").Replace(",",";");
            productType.BrandIds = RequestHelper.GetForm <string>("choosedBrnadIds").Replace(";;", ";");

            string alertMessage = ShopLanguage.ReadLanguage("AddOK");
            if (productType.Id == int.MinValue)
            {
                CheckAdminPower("AddProductType", PowerCheckType.Single);
                productTypeID = ProductTypeBLL.Add(productType);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("ProductType"), productTypeID);

                #region
                //添加相关属性
                string[] namelist  = RequestHelper.GetForm <string>("NameList").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                string[] valuelist = RequestHelper.GetForm <string>("ValueList").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                string[] typelist  = RequestHelper.GetForm <string>("TypeList").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                if (namelist.Length > 0)
                {
                    for (int t = 0; t < namelist.Length; t++)
                    {
                        ProductTypeAttributeInfo attribute = new ProductTypeAttributeInfo();
                        attribute.Name = namelist[t];
                        var _attribute = ProductTypeAttributeBLL.Read(attribute.Name, productTypeID);
                        if (_attribute.Id > 0)
                        {
                            ScriptHelper.Alert("该属性已存在,请重新输入", RequestHelper.RawUrl);
                        }
                        else
                        {
                            attribute.ProductTypeId = productTypeID;
                            int typeNum = 0;
                            int.TryParse(typelist[t], out typeNum);

                            attribute.InputType  = typeNum;
                            attribute.InputValue = valuelist[t].Replace('|', ';');
                            attribute.OrderId    = 0;

                            ProductTypeAttributeBLL.Add(attribute);
                        }
                    }
                }
                #endregion
                #region
                //添加相关规格
                string[] snamelist  = RequestHelper.GetForm <string>("SNameList").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                string[] svaluelist = RequestHelper.GetForm <string>("SValueList").Split(',');
                string[] stypelist  = RequestHelper.GetForm <string>("STypeList").Split(',');
                if (snamelist.Length > 0)
                {
                    for (int t = 0; t < snamelist.Length; t++)
                    {
                        ProductTypeStandardInfo standard = new ProductTypeStandardInfo();
                        standard.Name = snamelist[t];
                        var _standard = ProductTypeStandardBLL.Read(standard.Name, productTypeID);
                        if (_standard.Id > 0)
                        {
                            ScriptHelper.Alert("该规格已存在,请重新输入", RequestHelper.RawUrl);
                        }
                        else
                        {
                            standard.ProductTypeId = productTypeID;
                            int typeNum = 0;
                            int.TryParse(stypelist[t], out typeNum);

                            standard.ValueList = svaluelist[t].Replace('|', ';');

                            ProductTypeStandardBLL.Add(standard);
                        }
                    }
                }
                #endregion
            }
            else
            {
                CheckAdminPower("UpdateProductType", PowerCheckType.Single);
                ProductTypeBLL.Update(productType);
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("ProductType"), productType.Id);
                alertMessage = ShopLanguage.ReadLanguage("UpdateOK");

                #region
                //删除原有属性
                //ProductTypeAttributeBLL.DeleteList(productType.Id);

                //添加相关属性
                string[] namelist  = RequestHelper.GetForm <string>("NameList").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                string[] valuelist = RequestHelper.GetForm <string>("ValueList").Split(',');
                string[] typelist  = RequestHelper.GetForm <string>("TypeList").Split(',');
                string[] idList    = RequestHelper.GetForm <string>("IdList").Split(',');

                if (namelist.Length > 0)
                {
                    List <ProductTypeAttributeInfo> productTypeAttrList = ProductTypeAttributeBLL.ReadList(productType.Id);
                    for (int t = 0; t < namelist.Length; t++)
                    {
                        if (idList[t] != "0")
                        {
                            ProductTypeAttributeInfo attribute = ProductTypeAttributeBLL.Read(Convert.ToInt32(idList[t]));
                            attribute.Name = namelist[t];
                            var _attribute = ProductTypeAttributeBLL.Read(attribute.Name, productType.Id);
                            if (_attribute.Id != attribute.Id && _attribute.Id > 0)
                            {
                                ScriptHelper.Alert("该属性已存在,请重新输入", RequestHelper.RawUrl);
                            }
                            else
                            {
                                attribute.ProductTypeId = productType.Id;
                                int typeNum = 0;
                                int.TryParse(typelist[t], out typeNum);

                                attribute.InputType  = typeNum;
                                attribute.InputValue = valuelist[t].Replace('|', ';');
                                attribute.OrderId    = 0;

                                ProductTypeAttributeBLL.Update(attribute);
                            }
                        }
                        else
                        {
                            ProductTypeAttributeInfo attribute = new ProductTypeAttributeInfo();
                            attribute.Name = namelist[t];
                            var _attribute = ProductTypeAttributeBLL.Read(attribute.Name, productType.Id);
                            if (_attribute.Id > 0)
                            {
                                ScriptHelper.Alert("该属性已存在,请重新输入", RequestHelper.RawUrl);
                            }
                            else
                            {
                                attribute.ProductTypeId = productType.Id;
                                int typeNum = 0;
                                int.TryParse(typelist[t], out typeNum);

                                attribute.InputType  = typeNum;
                                attribute.InputValue = valuelist[t].Replace('|', ';');
                                attribute.OrderId    = 0;

                                ProductTypeAttributeBLL.Add(attribute);
                            }
                        }
                    }
                }
                #endregion
                #region
                //删除原有规格
                //ProductTypeStandardBLL.DeleteList(productType.Id);
                //添加相关规格
                string[] snamelist  = RequestHelper.GetForm <string>("SNameList").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                string[] svaluelist = RequestHelper.GetForm <string>("SValueList").Split(',');
                string[] stypelist  = RequestHelper.GetForm <string>("STypeList").Split(',');
                string[] sidList    = RequestHelper.GetForm <string>("SIdList").Split(',');

                if (snamelist.Length > 0)
                {
                    List <ProductTypeStandardInfo> productTypeStandardList = ProductTypeStandardBLL.ReadList(productType.Id);
                    for (int t = 0; t < snamelist.Length; t++)
                    {
                        if (sidList[t] != "0")
                        {
                            ProductTypeStandardInfo standard = ProductTypeStandardBLL.Read(Convert.ToInt32(sidList[t]));
                            standard.Name = snamelist[t];
                            var _standard = ProductTypeStandardBLL.Read(standard.Name, productType.Id);
                            if (_standard.Id != standard.Id && _standard.Id > 0)
                            {
                                ScriptHelper.Alert("该规格已存在,请重新输入", RequestHelper.RawUrl);
                            }
                            else
                            {
                                standard.ProductTypeId = productType.Id;
                                standard.ValueList     = svaluelist[t].Replace('|', ';');

                                ProductTypeStandardBLL.Update(standard);
                            }
                        }
                        else
                        {
                            ProductTypeStandardInfo standard = new ProductTypeStandardInfo();
                            standard.Name = snamelist[t];
                            var _standard = ProductTypeStandardBLL.Read(standard.Name, productType.Id);
                            if (_standard.Id > 0)
                            {
                                ScriptHelper.Alert("该规格已存在,请重新输入", RequestHelper.RawUrl);
                            }
                            else
                            {
                                standard.ProductTypeId = productType.Id;
                                standard.ValueList     = svaluelist[t].Replace('|', ';');

                                ProductTypeStandardBLL.Add(standard);
                            }
                        }
                    }
                }
                #endregion
            }
            #endregion


            ScriptHelper.Alert(alertMessage, RequestHelper.RawUrl);
        }
Esempio n. 3
0
        public ActionResult Detail(int id)
        {
            int userGrade = UserGradeBLL.ReadByMoney(0).Id;
            int uid       = RequestHelper.GetForm <int>("uid");
            var user      = UserBLL.ReadUserMore(uid);

            if (user.Id > 0)
            {
                userGrade     = UserGradeBLL.ReadByMoney(user.MoneyUsed).Id;
                user.UserName = HttpUtility.UrlDecode(user.UserName, System.Text.Encoding.UTF8);
            }

            if (id <= 0)
            {
                return(Json(new { ok = false, error = "该产品未上市" }));
            }
            string      fromwhere = RequestHelper.GetQueryString <string>("fw");
            ProductInfo product   = ProductBLL.Read(id);

            if (product.IsSale == (int)BoolType.False || product.IsDelete == 1)
            {
                return(Json(new { ok = false, error = "该产品未上市" }));
            }
            #region 如果商品没有小程序码 则生成并保存
            if (string.IsNullOrWhiteSpace(product.Qrcode))
            {
                string product_miniProramCode = string.Empty;
                CreateMiniProgramCode(product.Id, ref product_miniProramCode, product.Qrcode);
                if (!string.IsNullOrWhiteSpace(product_miniProramCode))
                {//如果调用接口成功生成小程序码(因为只有发布后才能使用此微信接口)
                    Dictionary <string, object> dict = new Dictionary <string, object>();
                    dict.Add("[Qrcode]", product_miniProramCode);
                    ProductBLL.UpdatePart("[Product]", dict, product.Id);
                    product.Qrcode = product_miniProramCode;
                }
            }
            #endregion
            //更新查看数量
            if (CookiesHelper.ReadCookie("productview" + product.Id + "") == null)
            {
                ProductBLL.ChangeViewCount(id, 1);
                CookiesHelper.AddCookie("productview" + product.Id + "", product.Id.ToString());
            }
            ProductCommentSearchInfo proCommSear = new ProductCommentSearchInfo();
            var proComm = ProductCommentBLL.SearchProductCommentList(proCommSear = new ProductCommentSearchInfo {
                ProductId = product.Id, Status = (int)CommentStatus.Show
            });
            var procomlist = new List <VirtualProductCommend>();
            foreach (var item in proComm)
            {
                VirtualProductCommend vpc = new VirtualProductCommend()
                {
                    id         = item.Id,
                    name       = HttpUtility.UrlDecode(item.UserName, Encoding.UTF8),
                    avator     = ShopCommon.ShowImage(UserBLL.Read(item.UserId).Photo),
                    lv         = item.Rank,
                    date       = item.PostDate,
                    content    = item.Content,
                    imglist    = ProductPhotoBLL.ReadList(item.Id, 3),
                    adminreply = item.AdminReplyContent,
                    replydate  = item.AdminReplyDate
                };
                procomlist.Add(vpc);
            }

            //产品价格
            int hotCount           = 0;
            var currentMemberPrice = ProductBLL.GetCurrentPrice(product.SalePrice, userGrade);
            var prorecommend       = ProductBLL.SearchList(1, 8, new ProductSearchInfo {
                IsSale = (int)BoolType.True, IsTop = (int)BoolType.True, IsDelete = (int)BoolType.False, NotInProductId = product.Id.ToString()
            }, ref hotCount);
            var prorelist = new List <ProductVirtualModel>();
            foreach (var item in prorecommend)
            {
                var vp = new ProductVirtualModel()
                {
                    id          = item.Id,
                    name        = item.Name,
                    img         = ShopCommon.ShowImage(item.Photo.Replace("Original", "150-150")),
                    imgbig      = ShopCommon.ShowImage(item.Photo.Replace("Original", "350-350")),
                    imgorg      = ShopCommon.ShowImage(item.Photo),
                    price       = ProductBLL.GetCurrentPrice(item.SalePrice, userGrade),
                    marketprice = item.MarketPrice,
                    click       = item.ViewCount,
                    like        = item.LikeNum,
                    totalstore  = item.StandardType == (int)ProductStandardType.Single ? ProductTypeStandardRecordBLL.GetSumStorageByProduct(item.Id) : item.TotalStorageCount,
                    //ordercount = item.OrderCount
                    //是否启用不限库存,分别计算销量
                    ordercount = item.UnlimitedStorage == 1 ? OrderBLL.GetProductOrderCountDaily(item.Id, item.StandardType, DateTime.Now) : item.OrderCount
                };
                prorelist.Add(vp);
            }
            //产品图片
            List <ProductPhotoInfo> productPhotoList = new List <ProductPhotoInfo>();
            ProductPhotoInfo        productPhoto     = new ProductPhotoInfo();
            productPhoto.Name     = product.Name;
            productPhoto.ImageUrl = product.Photo;
            productPhotoList.Add(productPhoto);
            productPhotoList.AddRange(ProductPhotoBLL.ReadList(id, 0));
            productPhotoList.ForEach(k => k.ImageUrl = k.ImageUrl.Replace("75-75", "Original"));
            //属性
            var attributeRecordList = ProductTypeAttributeRecordBLL.ReadList(id);

            #region 产品规格
            List <ProductTypeStandardInfo> standardList = new List <ProductTypeStandardInfo>();
            string  standardRecordValueList             = "|";
            var     standardRecordList = ProductTypeStandardRecordBLL.ReadListByProduct(product.Id, product.StandardType);
            decimal maxPrice           = product.SalePrice;
            if (standardRecordList.Count > 0)
            {
                string[] standardIDArray = standardRecordList[0].StandardIdList.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < standardIDArray.Length; i++)
                {
                    int standardID = Convert.ToInt32(standardIDArray[i]);
                    ProductTypeStandardInfo standard = ProductTypeStandardBLL.Read(standardID);
                    string[] valueArray = standard.ValueList.Split(';');
                    string   valueList  = string.Empty;
                    for (int k = 0; k < valueArray.Length; k++)
                    {
                        foreach (ProductTypeStandardRecordInfo standardRecord in standardRecordList)
                        {
                            if (standardRecord.MarketPrice > maxPrice)
                            {
                                maxPrice = standardRecord.MarketPrice;
                            }
                            string[] tempValueArray = standardRecord.ValueList.Split(';');
                            if (valueArray[k] == tempValueArray[i])
                            {
                                valueList += valueArray[k] + ";";
                                break;
                            }
                        }
                    }
                    if (valueList != string.Empty)
                    {
                        valueList = valueList.Substring(0, valueList.Length - 1);
                    }
                    standard.ValueList = valueList;
                    standardList.Add(standard);
                }
                //规格值
                foreach (ProductTypeStandardRecordInfo standardRecord in standardRecordList)
                {
                    standardRecordValueList += standardRecord.ProductId + ";" + standardRecord.ValueList + "|";
                }
            }
            #endregion
            #region 正在开的团(进行中,排除本人开的团)
            GroupBuySearchInfo gpsearch = new GroupBuySearchInfo
            {
                ProductId = product.Id,
                //NotLeader = user.Id,
                Status = (int)GroupBuyStatus.Going
            };
            List <GroupBuyInfo> gpList = GroupBuyBLL.SearchList(gpsearch);
            gpList.ForEach(k => k.groupSignList = GroupSignBLL.ReadListByGroupId(k.Id));
            gpList.ForEach(k => k.GroupUserName = System.Web.HttpUtility.UrlDecode(k.GroupUserName, Encoding.UTF8));
            #endregion
            return(Json(new
            {
                ok = true,
                product = new
                {
                    id = product.Id,
                    img = ShopCommon.ShowImage(product.Photo.Replace("Original", "350-350")),
                    imgorg = ShopCommon.ShowImage(product.Photo),
                    title = product.Name,
                    summary = product.Summary,
                    price = currentMemberPrice,
                    marketprice = product.MarketPrice,
                    intro = string.IsNullOrEmpty(product.Introduction1_Mobile) ? product.Introduction1 : product.Introduction1_Mobile,
                    remark = product.Remark,
                    totalstore = product.StandardType == (int)ProductStandardType.Single ? ProductTypeStandardRecordBLL.GetSumStorageByProduct(product.Id) : product.TotalStorageCount,
                    ordercount = product.UnlimitedStorage == 1 ? OrderBLL.GetProductOrderCountDaily(product.Id, product.StandardType, DateTime.Now) : product.OrderCount,
                    unlimitedstorage = product.UnlimitedStorage,
                    virtualordercount = product.VirtualOrderCount,
                    usevirtualorder = product.UseVirtualOrder,
                    opengroup = product.OpenGroup,
                    groupprice = product.GroupPrice,
                    groupquantity = product.GroupQuantity,
                    qrcode = product.Qrcode,
                    groupphoto = string.IsNullOrWhiteSpace(product.GroupPhoto) ? product.Photo : product.GroupPhoto
                },
                standardList = standardList,
                standardRecordValueList = standardRecordValueList,
                attributeRecordList = attributeRecordList,
                productPhotoList = productPhotoList,
                prorecommend = prorelist,
                proComm = procomlist,
                maxPrice = maxPrice,
                groupList = gpList
            }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 4
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();

            int count = int.MinValue;

            int id = RequestHelper.GetQueryString <int>("ID");

            if (id <= 0)
            {
                ScriptHelper.AlertFront("该产品未上市,不能查看");
            }
            string fromwhere = RequestHelper.GetQueryString <string>("fw");

            product = ProductBLL.Read(id);
            if (product.IsSale == (int)BoolType.False || product.IsDelete == 1)
            {
                if (fromwhere.ToLower() != "admin")
                {
                    ScriptHelper.Alert("该产品未上市,不能查看");
                }
                else
                {
                    if (Cookies.Admin.GetAdminID(true) == 0)//用户未登录
                    {
                        ScriptHelper.Alert("该产品未上市,不能查看");
                    }
                }
            }

            navList = ProductClassBLL.ProductClassNameList(product.ClassId);
            //更新查看数量
            ProductBLL.ChangeViewCount(id, 1);
            //会员等级
            userGradeList = UserGradeBLL.ReadList();

            //产品图片
            ProductPhotoInfo productPhoto = new ProductPhotoInfo();

            productPhoto.Name     = product.Name;
            productPhoto.ImageUrl = product.Photo.Replace("Original", "75-75");
            productPhotoList.Add(productPhoto);
            productPhotoList.AddRange(ProductPhotoBLL.ReadList(id, 0));
            // 关联产品,配件,浏览过的商品
            strHistoryProduct = Server.UrlDecode(CookiesHelper.ReadCookieValue("HistoryProduct"));
            string tempStrProductID = product.RelationProduct + "," + product.Accessory + "," + strHistoryProduct;

            tempStrProductID = tempStrProductID.Replace(",,", ",");
            if (tempStrProductID.StartsWith(","))
            {
                tempStrProductID = tempStrProductID.Substring(1);
            }
            if (tempStrProductID.EndsWith(","))
            {
                tempStrProductID = tempStrProductID.Substring(0, tempStrProductID.Length - 1);
            }

            ProductSearchInfo productSearch = new ProductSearchInfo();

            productSearch.InProductId = tempStrProductID;
            productSearch.IsDelete    = (int)BoolType.False;
            tempProductList           = ProductBLL.SearchList(productSearch);
            //产品规格
            standardRecordList = ProductTypeStandardRecordBLL.ReadListByProduct(product.Id, product.StandardType);
            if (standardRecordList.Count > 0)
            {
                string[] standardIDArray = standardRecordList[0].StandardIdList.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < standardIDArray.Length; i++)
                {
                    int standardID = Convert.ToInt32(standardIDArray[i]);
                    ProductTypeStandardInfo standard = ProductTypeStandardBLL.Read(standardID);
                    string[] valueArray = standard.ValueList.Split(';');
                    string   valueList  = string.Empty;
                    for (int k = 0; k < valueArray.Length; k++)
                    {
                        foreach (ProductTypeStandardRecordInfo standardRecord in standardRecordList)
                        {
                            string[] tempValueArray = standardRecord.ValueList.Split(';');
                            if (valueArray[k] == tempValueArray[i])
                            {
                                valueList += valueArray[k] + ";";
                                break;
                            }
                        }
                    }
                    if (valueList != string.Empty)
                    {
                        valueList = valueList.Substring(0, valueList.Length - 1);
                    }
                    standard.ValueList = valueList;
                    standardList.Add(standard);
                }
                //规格值
                foreach (ProductTypeStandardRecordInfo standardRecord in standardRecordList)
                {
                    standardRecordValueList += standardRecord.ProductId + ";" + standardRecord.ValueList + "|";
                }
            }
            //计算剩余库存量
            if (ShopConfig.ReadConfigInfo().ProductStorageType == (int)ProductStorageType.SelfStorageSystem)
            {
                leftStorageCount = product.TotalStorageCount - product.OrderCount;
            }
            else
            {
                leftStorageCount = product.ImportVirtualStorageCount;
            }
            //搜索优化
            Title       = product.Name;
            Keywords    = (product.Keywords == string.Empty) ? product.Name : product.Keywords;
            Description = (product.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(product.Introduction1), 200) : product.Summary;
        }
Esempio n. 5
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();

            int count = int.MinValue;

            topNav = 2;
            int id = RequestHelper.GetQueryString <int>("ID");

            if (id <= 0)
            {
                ScriptHelper.AlertFront("该产品未上市,不能查看");
            }
            string fromwhere = RequestHelper.GetQueryString <string>("fw");

            product = ProductBLL.Read(id);
            if (product.IsSale == (int)BoolType.False || product.IsDelete == 1)
            {
                if (fromwhere.ToLower() != "admin")
                {
                    ScriptHelper.AlertFront("该产品未上市,不能查看");
                }
                else
                {
                    if (Cookies.Admin.GetAdminID(true) == 0)//用户未登录
                    {
                        ScriptHelper.AlertFront("该产品未上市,不能查看");
                    }
                }
            }

            navList = ProductClassBLL.ProductClassNameList(product.ClassId);
            //更新查看数量
            if (CookiesHelper.ReadCookie("productview" + product.Id + "") == null)
            {
                ProductBLL.ChangeViewCount(id, 1);
                CookiesHelper.AddCookie("productview" + product.Id + "", product.Id.ToString());
            }
            ProductCommentSearchInfo proCommSear = new ProductCommentSearchInfo();

            proComm = ProductCommentBLL.SearchProductCommentList(proCommSear = new ProductCommentSearchInfo {
                ProductId = product.Id
            });

            //会员等级
            userGradeList = UserGradeBLL.ReadList();
            //产品价格
            int hotCount = 0;

            currentMemberPrice = ProductBLL.GetCurrentPrice(product.SalePrice, base.GradeID);
            hotProductList     = ProductBLL.SearchList(1, 7, new ProductSearchInfo {
                IsHot = (int)BoolType.True, IsSale = (int)BoolType.True, IsDelete = (int)BoolType.False, NotInProductId = product.Id.ToString()
            }, ref hotCount);
            ishot = ProductBLL.SearchList(1, 7, new ProductSearchInfo {
                IsHot = (int)BoolType.True, IsSale = (int)BoolType.True, IsTop = (int)BoolType.True, IsDelete = (int)BoolType.False, NotInProductId = product.Id.ToString()
            }, ref hotCount);
            proishot = ProductBLL.SearchList(1, 3, new ProductSearchInfo {
                IsSale = (int)BoolType.True, IsTop = (int)BoolType.True, IsDelete = (int)BoolType.False, NotInProductId = product.Id.ToString()
            }, ref hotCount);

            //产品图片
            ProductPhotoInfo productPhoto = new ProductPhotoInfo();

            productPhoto.Name     = product.Name;
            productPhoto.ImageUrl = product.Photo;
            productPhotoList.Add(productPhoto);
            productPhotoList.AddRange(ProductPhotoBLL.ReadList(id, 0));
            // 关联产品,配件,浏览过的商品
            strHistoryProduct = Server.UrlDecode(CookiesHelper.ReadCookieValue("HistoryProduct"));
            string tempStrProductID = product.RelationProduct + "," + product.Accessory + "," + strHistoryProduct;

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

            productSearch.InProductId = tempStrProductID;
            tempProductList           = ProductBLL.SearchList(productSearch);

            //属性
            attributeRecordList = ProductTypeAttributeRecordBLL.ReadList(id);

            //产品文章
            if (product.RelationArticle != string.Empty)
            {
                ArticleSearchInfo articleSearch = new ArticleSearchInfo();
                articleSearch.InArticleId = product.RelationArticle;
                productArticleList        = ArticleBLL.SearchList(articleSearch);
            }
            //产品规格
            standardRecordList = ProductTypeStandardRecordBLL.ReadListByProduct(product.Id, product.StandardType);
            if (standardRecordList.Count > 0)
            {
                string[] standardIDArray = standardRecordList[0].StandardIdList.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < standardIDArray.Length; i++)
                {
                    int standardID = Convert.ToInt32(standardIDArray[i]);
                    ProductTypeStandardInfo standard = ProductTypeStandardBLL.Read(standardID);
                    string[] valueArray = standard.ValueList.Split(';');
                    string   valueList  = string.Empty;
                    for (int k = 0; k < valueArray.Length; k++)
                    {
                        foreach (ProductTypeStandardRecordInfo standardRecord in standardRecordList)
                        {
                            string[] tempValueArray = standardRecord.ValueList.Split(';');
                            if (valueArray[k] == tempValueArray[i])
                            {
                                valueList += valueArray[k] + ";";
                                break;
                            }
                        }
                    }
                    if (valueList != string.Empty)
                    {
                        valueList = valueList.Substring(0, valueList.Length - 1);
                    }
                    standard.ValueList = valueList;
                    standardList.Add(standard);
                }
                //规格值
                foreach (ProductTypeStandardRecordInfo standardRecord in standardRecordList)
                {
                    standardRecordValueList += standardRecord.ProductId + ";" + standardRecord.ValueList + "|";
                }
            }
            //计算剩余库存量

            leftStorageCount = product.TotalStorageCount - product.OrderCount;

            //搜索优化
            Title       = (product.SubTitle == string.Empty) ? product.Name : product.SubTitle;
            Keywords    = (product.Keywords == string.Empty) ? product.Name : product.Keywords;
            Description = (product.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(product.Introduction1), 200) : product.Summary;
        }