Exemplo n.º 1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                //this.ddlCountry.DataBind();
                this.ddListDisplaySequence.DataBind();

                if (int.TryParse(base.Request.QueryString["importSourceId"], out this.importsId))
                {
                    txtImportSourceId.Text = importsId.ToString();

                    ImportSourceTypeInfo ImInfo = ImportSourceTypeHelper.GetImportSourceTypeInfo(importsId);

                    if (ImInfo != null)
                    {
                        txtCnArea.Text = ImInfo.CnArea;
                        txtEnArea.Text = ImInfo.EnArea;
                        txtRemark.Text = ImInfo.Remark;
                        ddListDisplaySequence.SelectedValue = ImInfo.DisplaySequence;
                        uploaderIcon.UploadedImageUrl       = ImInfo.Icon;
                        //txtHSCode.Text = ImInfo.HSCode;
                        if (ImInfo.FavourableFlag)
                        {
                            radFavourableFlagY.Checked = true;
                        }
                        else
                        {
                            radFavourableFlagN.Checked = true;
                        }
                        hidCountryId.Value = ImInfo.HSCode;
                        hidCountry.Value   = ImInfo.StandardCName;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            if (hidCountryId.Value == "")
            {
                this.ShowMsg("请选择国家。", false);
                return;
            }
            ImportSourceTypeInfo importSourceTypeInfo = new ImportSourceTypeInfo
            {
                CnArea          = txtCnArea.Text,
                EnArea          = txtEnArea.Text,
                Remark          = txtRemark.Text,
                Icon            = uploaderIcon.UploadedImageUrl,
                DisplaySequence = ddListDisplaySequence.SelectedValue,
                HSCode          = hidCountryId.Value,
                FavourableFlag  = radFavourableFlagY.Checked,
                StandardCName   = hidCountry.Value
            };

            int importSourceId = ImportSourceTypeHelper.AddImportSourceType(importSourceTypeInfo);

            if (importSourceId > 0)
            {
                HiCache.Remove("DataCache-ImportSourceTypeInfo");
                this.ShowMsg("添加原产地成功", true);
                base.Response.Redirect(Globals.GetAdminAbsolutePath(string.Format("/product/AddImportSourceTypeComplete.aspx?importSourceId={0}", importSourceId)), true);
                return;
            }
            else
            {
                this.ShowMsg("添加原产地失败,未知错误", false);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="importSourceType"></param>
        /// <returns></returns>
        public int UpdateImportSourceType(ImportSourceTypeInfo importSourceType)
        {
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand(@"update Ecshop_ImportSourceType set Icon=@Icon,EnArea=@EnArea,CnArea=@CnArea,Remark=@Remark,DisplaySequence=@DisplaySequence,HSCode=@HSCode,FavourableFlag=@FavourableFlag,StandardCName=@StandardCName where ImportSourceId = @ImportSourceId");

            this.database.AddInParameter(sqlStringCommand, "Icon", DbType.String, importSourceType.Icon);
            this.database.AddInParameter(sqlStringCommand, "EnArea", DbType.String, importSourceType.EnArea);
            this.database.AddInParameter(sqlStringCommand, "CnArea", DbType.String, importSourceType.CnArea);
            this.database.AddInParameter(sqlStringCommand, "Remark", DbType.String, importSourceType.Remark);
            this.database.AddInParameter(sqlStringCommand, "DisplaySequence", DbType.Int32, importSourceType.DisplaySequence);
            this.database.AddInParameter(sqlStringCommand, "ImportSourceId", DbType.Int32, importSourceType.ImportSourceId);
            this.database.AddInParameter(sqlStringCommand, "HSCode", DbType.String, importSourceType.HSCode);
            this.database.AddInParameter(sqlStringCommand, "FavourableFlag", DbType.Boolean, importSourceType.FavourableFlag);
            this.database.AddInParameter(sqlStringCommand, "StandardCName", DbType.String, importSourceType.StandardCName);
            return(this.database.ExecuteNonQuery(sqlStringCommand));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="importSourceType"></param>
        /// <returns></returns>
        public int AddImportSourceType(ImportSourceTypeInfo importSourceType)
        {
            int       result           = 0;
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand(@"INSERT [dbo].[Ecshop_ImportSourceType] ([Icon], [EnArea], [CnArea], [Remark], [DisplaySequence],[HSCode],[FavourableFlag],[StandardCName]) VALUES (@Icon,@EnArea,@CnArea,@Remark,@DisplaySequence,@HSCode,@FavourableFlag,@StandardCName);select @@IDENTITY;");

            this.database.AddInParameter(sqlStringCommand, "Icon", DbType.String, importSourceType.Icon);
            this.database.AddInParameter(sqlStringCommand, "EnArea", DbType.String, importSourceType.EnArea);
            this.database.AddInParameter(sqlStringCommand, "CnArea", DbType.String, importSourceType.CnArea);
            this.database.AddInParameter(sqlStringCommand, "Remark", DbType.String, importSourceType.Remark);
            this.database.AddInParameter(sqlStringCommand, "DisplaySequence", DbType.Int32, importSourceType.DisplaySequence);

            this.database.AddInParameter(sqlStringCommand, "HSCode", DbType.String, importSourceType.HSCode);
            this.database.AddInParameter(sqlStringCommand, "FavourableFlag", DbType.Boolean, importSourceType.FavourableFlag);
            this.database.AddInParameter(sqlStringCommand, "StandardCName", DbType.String, importSourceType.StandardCName);
            int.TryParse(this.database.ExecuteScalar(sqlStringCommand).ToString(), out result);
            return(result);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取原产地信息
        /// </summary>
        /// <param name="importSourceId"></param>
        /// <returns></returns>
        public ImportSourceTypeInfo GetImportSourceTypeInfo(int importSourceId)
        {
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand(@"select ImportSourceId,Icon,EnArea,CnArea,Remark,DisplaySequence,AddTime,HSCode,FavourableFlag,StandardCName from Ecshop_ImportSourceType where ImportSourceId = @ImportSourceId");

            this.database.AddInParameter(sqlStringCommand, "ImportSourceId", DbType.Int32, importSourceId);

            ImportSourceTypeInfo result = null;

            using (IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
            {
                if (dataReader.Read())
                {
                    result = DataMapper.PopulateImportSourceTypeInfo(dataReader);
                }
            }
            return(result);
        }
Exemplo n.º 6
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("");
            }
            if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            {
                string text = System.Web.HttpContext.Current.Request.Url.ToString();
                if (text.IndexOf("?") > -1)
                {
                    text = text + "&ReferralUserId=" + HiContext.Current.User.UserId;
                }
                else
                {
                    text = text + "?ReferralUserId=" + HiContext.Current.User.UserId;
                }
                this.Page.Response.Redirect(text);
                return;
            }
            this.rptProductImages      = (WapTemplatedRepeater)this.FindControl("rptProductImages");
            this.litProdcutName        = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litSalePrice          = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litMarketPrice        = (System.Web.UI.WebControls.Literal) this.FindControl("litMarketPrice");
            this.litShortDescription   = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litDescription        = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
            this.litTaxRate            = (System.Web.UI.WebControls.Literal) this.FindControl("litTaxRate");
            this.litShipping           = (System.Web.UI.WebControls.Literal) this.FindControl("litShipping");
            this.litStock              = (System.Web.UI.WebControls.Literal) this.FindControl("litStock");
            this.skuSelector           = (Common_SKUSelector)this.FindControl("skuSelector");
            this.linkDescription       = (System.Web.UI.WebControls.HyperLink) this.FindControl("linkDescription");
            this.expandAttr            = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
            this.litSoldCount          = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount");
            this.litConsultationsCount = (System.Web.UI.WebControls.Literal) this.FindControl("litConsultationsCount");
            this.litReviewsCount       = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewsCount");
            this.litHasCollected       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litHasCollected");
            this.hidden_skus           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus");
            this.lbUserProductRefer    = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.promote   = (ProductPromote)this.FindControl("ProductPromote");
            this.litCnArea = (System.Web.UI.WebControls.Literal) this.FindControl("litCnArea");
            //this.imgIcon = (HiImage)this.FindControl("imgIcon");

            ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, null);

            System.Collections.IEnumerable value =
                from item in productBrowseInfo.Product.Skus
                select item.Value;

            if (this.hidden_skus != null)
            {
                this.hidden_skus.Value = JsonConvert.SerializeObject(value);
            }
            if (productBrowseInfo == null)
            {
                base.GotoResourceNotFound("此商品已不存在");
            }
            if (productBrowseInfo.Product.SaleStatus != ProductSaleStatus.OnSale)
            {
                base.GotoResourceNotFound("此商品已下架");
            }
            if (!productBrowseInfo.Product.IsApproved)
            {
                base.GotoResourceNotFound("此商品未审核");
            }
            //if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            //{
            //    string text = System.Web.HttpContext.Current.Request.Url.ToString();
            //    if (text.IndexOf("?") > -1)
            //    {
            //        text = text + "&ReferralUserId=" + HiContext.Current.User.UserId;
            //    }
            //    else
            //    {
            //        text = text + "?ReferralUserId=" + HiContext.Current.User.UserId;
            //    }
            //    base.RegisterShareScript(productBrowseInfo.Product.ImageUrl4, text, productBrowseInfo.Product.ShortDescription, productBrowseInfo.Product.ProductName);
            //}
            if (this.lbUserProductRefer != null)
            {
                this.lbUserProductRefer.product = productBrowseInfo.Product;
            }

            ImportSourceTypeInfo imSourceType = ProductBrowser.GetProductImportSourceType(this.productId);

            if (this.litCnArea != null && imSourceType != null)
            {
                this.litCnArea.Text = imSourceType.CnArea;
            }

            //if (this.imgIcon != null && imSourceType != null)
            //{
            //    this.imgIcon.ImageUrl = imSourceType.Icon;
            //}

            if (this.rptProductImages != null)
            {
                string       locationUrl = "javascript:;";
                SlideImage[] source      = new SlideImage[]
                {
                    new SlideImage(productBrowseInfo.Product.ImageUrl1, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl2, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl3, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl4, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl5, locationUrl),
                };
                this.rptProductImages.DataSource =
                    from item in source
                    where !string.IsNullOrWhiteSpace(item.ImageUrl)
                    select item;
                this.rptProductImages.DataBind();
            }
            this.litProdcutName.Text = productBrowseInfo.Product.ProductName;
            this.litSalePrice.Text   = productBrowseInfo.Product.MinSalePrice.ToString("F2");
            if (productBrowseInfo.Product.MarketPrice.HasValue)
            {
                this.litMarketPrice.SetWhenIsNotNull(productBrowseInfo.Product.MarketPrice.GetValueOrDefault(0m).ToString("F2"));
            }
            this.litShortDescription.Text = productBrowseInfo.Product.ShortDescription;
            if (this.litDescription != null)
            {
                System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("<script[^>]*?>.*?</script>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.MobblieDescription))
                {
                    this.litDescription.Text = regex.Replace(productBrowseInfo.Product.MobblieDescription, "");
                }
                else
                {
                    if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.Description))
                    {
                        this.litDescription.Text = regex.Replace(productBrowseInfo.Product.Description, "");
                    }
                }
            }
            this.litSoldCount.SetWhenIsNotNull(productBrowseInfo.Product.ShowSaleCounts.ToString());
            this.litStock.Text   = productBrowseInfo.Product.Stock.ToString();
            this.litTaxRate.Text = (productBrowseInfo.Product.TaxRate * 100).ToString("0");

            //运费模版
            ShippingModeInfo shippingMode = ShoppingProcessor.GetShippingMode(Int32.Parse(productBrowseInfo.Product.TemplateId != null ? productBrowseInfo.Product.TemplateId.ToString() : "0"));

            this.litShipping.Text = shippingMode != null ? shippingMode.TemplateName : "未设置";

            this.skuSelector.ProductId = this.productId;
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = this.productId;
            }
            if (this.linkDescription != null)
            {
                this.linkDescription.NavigateUrl = "/Vshop/ProductDescription.aspx?productId=" + this.productId;
            }
            this.litConsultationsCount.SetWhenIsNotNull(productBrowseInfo.ConsultationCount.ToString());
            this.litReviewsCount.SetWhenIsNotNull(productBrowseInfo.ReviewCount.ToString());
            Member member = HiContext.Current.User as Member;
            bool   flag   = false;

            if (member != null)
            {
                flag = ProductBrowser.CheckHasCollect(member.UserId, this.productId);
            }
            this.litHasCollected.SetWhenIsNotNull(flag ? "1" : "0");

            if (this.promote != null)
            {
                this.promote.ProductId = this.productId;
            }
            PageTitle.AddSiteNameTitle(productBrowseInfo.Product.ProductName);
        }
Exemplo n.º 7
0
        private void LoadProductInfo(ProductInfo productDetails, string brandName)
        {
            if (this.common_Location != null && !string.IsNullOrEmpty(productDetails.MainCategoryPath))
            {
                this.common_Location.CateGoryPath = productDetails.MainCategoryPath.Remove(productDetails.MainCategoryPath.Length - 1);
                this.common_Location.ProductName  = productDetails.ProductName;
            }
            this.litProductName.Text = productDetails.ProductName;
            this.lblProductCode.Text = productDetails.ProductCode;
            this.lblSku.Text         = productDetails.SKU;
            this.lblSku.Value        = productDetails.SkuId;
            this.hiddeSkuId.Value    = productDetails.SkuId;

            this.lblStock.Stock = productDetails.Stock;

            string unit = productDetails.Unit;

            if (!string.IsNullOrEmpty(unit))
            {
                this.litUnit.Text = productDetails.Unit;
            }
            else
            {
                this.litUnit.Text = "件";
            }


            if (productDetails.BuyCardinality > 1)
            {
                this.litBuyCardinality.Text = "起购数:" + productDetails.BuyCardinality;
            }
            else
            {
                this.litBuyCardinality.Visible = false;
            }
            buyCardinality.Value = productDetails.BuyCardinality.ToString();

            if (productDetails.Weight > 0m)
            {
                this.litWeight.Text = string.Format("{0:F2} g", productDetails.Weight);
            }
            else
            {
                this.litWeight.Text = "无";
            }
            this.litBrosedNum.Text = productDetails.VistiCounts.ToString();
            this.litBrand.Text     = brandName;
            if (this.litSaleCounts != null)
            {
                this.litSaleCounts.Text = productDetails.ShowSaleCounts.ToString();
            }
            if (productDetails.MinSalePrice == productDetails.MaxSalePrice)
            {
                this.lblBuyPrice.Text    = productDetails.MinSalePrice.ToString("F2");
                this.lblTotalPrice.Value = new decimal?(productDetails.MinSalePrice);
            }
            else
            {
                this.lblBuyPrice.Text = productDetails.MinSalePrice.ToString("F2") + " - " + productDetails.MaxSalePrice.ToString("F2");
            }
            this.hiddensupplierid.Value = productDetails.SupplierId.ToString();
            this.lblMarkerPrice.Money   = productDetails.MarketPrice;
            if (productDetails.MarketPrice.HasValue && productDetails.MarketPrice > 0)
            {
                this.litMarkPrice.Text = string.Format("市场价:<span id='sp_MarketPrice'>¥{0}</span>", Globals.FormatMoney((decimal)productDetails.MarketPrice));
            }
            this.litDescription.Text = productDetails.Description;
            if (this.litShortDescription != null)
            {
                this.litShortDescription.Text = productDetails.ShortDescription;
            }

            if (this.litTaxRate != null)
            {
                // 组合商品

                this.litTaxRate.Text = productDetails.GetExtendTaxRate();
            }

            ImportSourceTypeInfo imSourceType = ProductBrowser.GetProductImportSourceType(this.productId);

            if (this.litCnArea != null && imSourceType != null)
            {
                this.litCnArea.Text = imSourceType.CnArea;
            }

            if (this.imgIcon != null && imSourceType != null)
            {
                this.imgIcon.ImageUrl = imSourceType.Icon;
            }

            if (this.litShipping != null)
            {
                this.litShipping.Text = productDetails.TemplateName;
            }


            this.lblsmalltitle.Text = productDetails.ProductTitle;
            //if (this.lblStock.Stock ==0)
            //{
            //    //if (productImg != null)
            //    //{
            //    //    productImg.Visible = false;
            //    //}

            //    //if (btnaddgouwu != null)
            //    //{
            //    //    btnaddgouwu.Visible = false;
            //    //}

            //    //if (nowBuyBtn != null)
            //    //{
            //    //    nowBuyBtn.Visible = false;
            //    //}
            //}
        }
Exemplo n.º 8
0
 public static int UpdateImportSourceType(ImportSourceTypeInfo importSourceType)
 {
     return(new ImportSourceTypeDao().UpdateImportSourceType(importSourceType));
 }
Exemplo n.º 9
0
 public static int AddImportSourceType(ImportSourceTypeInfo importSourceType)
 {
     return(new ImportSourceTypeDao().AddImportSourceType(importSourceType));
 }
Exemplo n.º 10
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("");
            }
            this.rptProductImages    = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.litProdcutName      = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litSalePrice        = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litMarketPrice      = (System.Web.UI.WebControls.Literal) this.FindControl("litMarketPrice");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litDescription      = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
            this.litTaxRate          = (System.Web.UI.WebControls.Literal) this.FindControl("litTaxRate");
            this.litShipping         = (System.Web.UI.WebControls.Literal) this.FindControl("litShipping");
            this.litStock            = (System.Web.UI.WebControls.Literal) this.FindControl("litStock");
            this.litBuyCardinality   = (System.Web.UI.WebControls.Literal) this.FindControl("litBuyCardinality");
            this.litSupplier         = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplier");
            this.lblsmalltitle       = (System.Web.UI.WebControls.Literal) this.FindControl("lblsmalltitle");
            this.litDiscrunt         = (System.Web.UI.WebControls.Literal) this.FindControl("litDiscrunt");
            this.litpropricemsg      = (System.Web.UI.WebControls.Literal) this.FindControl("litpropricemsg");
            this.litProPromration    = (System.Web.UI.WebControls.Literal) this.FindControl("litProPromration");
            this.litOrderPromration  = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderPromration");
            this.litFreeShip         = (System.Web.UI.WebControls.Literal) this.FindControl("litFreeShip");

            this.skuSelector           = (Common_SKUSelector)this.FindControl("skuSelector");
            this.linkDescription       = (System.Web.UI.WebControls.HyperLink) this.FindControl("linkDescription");
            this.expandAttr            = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
            this.litSoldCount          = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount");
            this.litConsultationsCount = (System.Web.UI.WebControls.Literal) this.FindControl("litConsultationsCount");
            this.litReviewsCount       = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewsCount");
            this.litHasCollected       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litHasCollected");
            this.hidden_skus           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus");
            this.hidden_BuyCardinality = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_BuyCardinality");
            this.lbUserProductRefer    = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.promote   = (ProductPromote)this.FindControl("ProductPromote");
            this.litCnArea = (System.Web.UI.WebControls.Literal) this.FindControl("litCnArea");
            this.imgIcon   = (HiImage)this.FindControl("imgIcon");
            //this.imgSupplierIcon = (HiImage)this.FindControl("imgSupplierIcon");

            ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, null);

            if (productBrowseInfo == null)
            {
                base.GotoResourceNotFound("此商品已不存在");
            }

            if (productBrowseInfo.Product == null)
            {
                base.GotoResourceNotFound("此商品已不存在");
            }
            if (productBrowseInfo.Product.SaleStatus != ProductSaleStatus.OnSale)
            {
                base.GotoResourceNotFound("此商品已下架");
            }
            if (!productBrowseInfo.Product.IsApproved)
            {
                base.GotoResourceNotFound("此商品未审核");
            }


            System.Collections.IEnumerable value =
                from item in productBrowseInfo.Product.Skus
                select item.Value;

            if (this.hidden_skus != null)
            {
                this.hidden_skus.Value = JsonConvert.SerializeObject(value);
            }


            if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            {
                string text = System.Web.HttpContext.Current.Request.Url.ToString();
                if (text.IndexOf("?") > -1)
                {
                    text = text + "&ReferralUserId=" + HiContext.Current.User.UserId;
                }
                else
                {
                    text = text + "?ReferralUserId=" + HiContext.Current.User.UserId;
                }
                base.RegisterShareScript(productBrowseInfo.Product.ImageUrl4, text, productBrowseInfo.Product.ShortDescription, productBrowseInfo.Product.ProductName);
            }
            if (this.lbUserProductRefer != null)
            {
                this.lbUserProductRefer.product = productBrowseInfo.Product;
            }

            ImportSourceTypeInfo imSourceType = ProductBrowser.GetProductImportSourceType(this.productId);

            if (this.litCnArea != null && imSourceType != null)
            {
                this.litCnArea.Text = imSourceType.CnArea;
            }

            if (this.imgIcon != null && imSourceType != null)
            {
                this.imgIcon.ImageUrl = imSourceType.Icon;
            }

            if (this.rptProductImages != null)
            {
                string       locationUrl = "javascript:;";
                SlideImage[] source      = new SlideImage[]
                {
                    new SlideImage(productBrowseInfo.Product.ImageUrl1, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl2, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl3, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl4, locationUrl),
                    new SlideImage(productBrowseInfo.Product.ImageUrl5, locationUrl),
                };
                this.rptProductImages.DataSource =
                    from item in source
                    where !string.IsNullOrWhiteSpace(item.ImageUrl)
                    select item;
                this.rptProductImages.DataBind();
            }
            this.litProdcutName.Text = productBrowseInfo.Product.ProductName;
            this.litSalePrice.Text   = productBrowseInfo.Product.MinSalePrice.ToString("F2");
            if (productBrowseInfo.Product.MarketPrice.HasValue)
            {
                this.litMarketPrice.SetWhenIsNotNull(productBrowseInfo.Product.MarketPrice.GetValueOrDefault(0m).ToString("F2"));
            }
            this.litShortDescription.Text = productBrowseInfo.Product.ShortDescription;
            if (this.litDescription != null)
            {
                System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("<script[^>]*?>.*?</script>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.MobblieDescription))
                {
                    this.litDescription.Text = regex.Replace(productBrowseInfo.Product.MobblieDescription, "");
                }
                else
                {
                    if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.Description))
                    {
                        this.litDescription.Text = regex.Replace(productBrowseInfo.Product.Description, "");
                    }
                }
            }
            this.litSoldCount.SetWhenIsNotNull(productBrowseInfo.Product.ShowSaleCounts.ToString());
            this.litStock.Text = productBrowseInfo.Product.Stock.ToString();
            //this.litTaxRate.Text = (productBrowseInfo.Product.TaxRate * 100).ToString("0");

            if (this.litTaxRate != null)
            {
                this.litTaxRate.Text = productBrowseInfo.Product.GetExtendTaxRate();
            }

            if (productBrowseInfo.Product.BuyCardinality > 1)
            {
                this.litBuyCardinality.Text = "起购数:" + productBrowseInfo.Product.BuyCardinality;
            }
            else
            {
                this.litBuyCardinality.Visible = false;
            }
            this.hidden_BuyCardinality.Value = productBrowseInfo.Product.BuyCardinality.ToString();

            //运费模版
            ShippingModeInfo shippingMode = ShoppingProcessor.GetShippingMode(Int32.Parse(productBrowseInfo.Product.TemplateId != null ? productBrowseInfo.Product.TemplateId.ToString() : "0"));

            this.litShipping.Text = shippingMode != null ? shippingMode.TemplateName : "未设置";

            this.skuSelector.ProductId = this.productId;
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = this.productId;
            }
            if (this.linkDescription != null)
            {
                this.linkDescription.NavigateUrl = "/Vshop/ProductDescription.aspx?productId=" + this.productId;
            }
            this.litConsultationsCount.SetWhenIsNotNull(productBrowseInfo.ConsultationCount.ToString());
            this.litReviewsCount.SetWhenIsNotNull(productBrowseInfo.ReviewCount.ToString());
            Member member     = HiContext.Current.User as Member;
            int    favoriteId = 0;

            if (member != null)
            {
                favoriteId = ProductBrowser.GetFavoriteId(member.UserId, this.productId);
            }
            this.litHasCollected.SetWhenIsNotNull(favoriteId.ToString());

            if (this.promote != null)
            {
                this.promote.ProductId = this.productId;
            }
            PageTitle.AddSiteNameTitle(productBrowseInfo.Product.ProductName);

            //this.litSupplierName.Text = productBrowseInfo.SupplierName;

            //if (this.imgSupplierIcon != null && productBrowseInfo.SupplierImageUrl != null)
            //{
            //    this.imgSupplierIcon.ImageUrl = productBrowseInfo.SupplierImageUrl;
            //}

            if (productBrowseInfo.Product.SupplierId == null || productBrowseInfo.Product.SupplierId == 0)
            {
                this.litSupplier.Text = "";
            }
            else
            {
                this.litSupplier.Text = "<a class=\"shop-link fix\" href=\"/vshop/SupProductList.aspx?SupplierId=" + productBrowseInfo.Product.SupplierId + "\"><span>进入店铺</span><img src=\"" + productBrowseInfo.SupplierLogo + "\"/>" + productBrowseInfo.SupplierName + "</a>";
            }

            this.lblsmalltitle.Text = productBrowseInfo.Product.ProductTitle;

            //this.litDiscrunt = (System.Web.UI.WebControls.Literal)this.FindControl("litDiscrunt");
            //this.litpropricemsg = (System.Web.UI.WebControls.Literal)this.FindControl("litpropricemsg");
            //显示促销信息
            if (productBrowseInfo.Product.IsPromotion)
            {
                this.litpropricemsg.Text = "<span class=\"pro-pricemsg\">促销价</span>";
            }

            decimal tempMinSalePrice = productBrowseInfo.Product.MinSalePrice;                      //折扣价
            decimal tempMarketPrice  = productBrowseInfo.Product.MarketPrice.GetValueOrDefault(0m); //会员价
            decimal tempDiscrunt     = 1M;

            if (tempMarketPrice > 0)
            {
                tempDiscrunt = (tempMinSalePrice / tempMarketPrice) * 10;
            }
            //显示折扣信息
            if (productBrowseInfo.Product.IsDisplayDiscount)
            {
                this.litDiscrunt.Text = "<span class=\"pro-discrunt\">" + tempDiscrunt.ToString("F2") + "折</span>";
            }


            //PromotionInfo promotionInfo;
            List <OrderPromotionItem>   orderpromotionlist   = new List <OrderPromotionItem>();
            List <ProductPromotionItem> productpromotionlist = new List <ProductPromotionItem>();

            if (member != null)
            {
                //promotionInfo = ProductBrowser.GetProductPromotionInfo(member, productId);
                DataTable dtorderpromotion = ProductBrowser.GetOrderPromotionInfo(member);
                if (dtorderpromotion != null)
                {
                    OrderPromotionItem item = null;
                    foreach (DataRow row in dtorderpromotion.Rows)
                    {
                        item = new OrderPromotionItem();
                        if (row["Name"] != DBNull.Value)
                        {
                            item.Name = (string)row["Name"];
                        }
                        if (row["PromoteType"] != DBNull.Value)
                        {
                            item.PromoteType = (int)row["PromoteType"];
                        }
                        orderpromotionlist.Add(item);
                    }
                }

                DataTable dtproductpromotion = ProductBrowser.GetProductPromotionList(member, productId);
                if (dtproductpromotion != null)
                {
                    ProductPromotionItem item = null;
                    foreach (DataRow row in dtproductpromotion.Rows)
                    {
                        item = new ProductPromotionItem();
                        if (row["Name"] != DBNull.Value)
                        {
                            item.Name = (string)row["Name"];
                        }
                        if (row["PromoteType"] != DBNull.Value)
                        {
                            item.PromoteType = (int)row["PromoteType"];
                        }
                        productpromotionlist.Add(item);
                    }
                }
            }
            else
            {
                //promotionInfo = ProductBrowser.GetAllProductPromotionInfo(productId);
                DataTable dtorderpromotion = ProductBrowser.GetAllOrderPromotionInfo();
                if (dtorderpromotion != null)
                {
                    OrderPromotionItem item = null;
                    foreach (DataRow row in dtorderpromotion.Rows)
                    {
                        item = new OrderPromotionItem();
                        if (row["Name"] != DBNull.Value)
                        {
                            item.Name = (string)row["Name"];
                        }
                        if (row["PromoteType"] != DBNull.Value)
                        {
                            item.PromoteType = (int)row["PromoteType"];
                        }
                        orderpromotionlist.Add(item);
                    }
                }

                DataTable dtproductpromotion = ProductBrowser.GetAllProductPromotionList(productId);

                if (dtproductpromotion != null)
                {
                    ProductPromotionItem item = null;
                    foreach (DataRow row in dtproductpromotion.Rows)
                    {
                        item = new ProductPromotionItem();
                        if (row["Name"] != DBNull.Value)
                        {
                            item.Name = (string)row["Name"];
                        }
                        if (row["PromoteType"] != DBNull.Value)
                        {
                            item.PromoteType = (int)row["PromoteType"];
                        }
                        productpromotionlist.Add(item);
                    }
                }
            }


            //this.litProPromration = (System.Web.UI.WebControls.Literal)this.FindControl("litProPromration");
            //this.litOrderPromration = (System.Web.UI.WebControls.Literal)this.FindControl("litOrderPromration");
            //包邮
            if (orderpromotionlist != null)
            {
                for (int i = 0; i < orderpromotionlist.Count; i++)
                {
                    if (orderpromotionlist[i].PromoteType == 17)
                    {
                        this.litFreeShip.Text = "<div><span style=\"color:#999\">" + orderpromotionlist[i].Name + "</span></div>";
                    }
                    else
                    {
                        this.litOrderPromration.Text = "<span>" + orderpromotionlist[i].Name + "</span>";
                    }
                }
            }
            if (productpromotionlist != null)
            {
                for (int i = 0; i < productpromotionlist.Count; i++)
                {
                    this.litProPromration.Text = "<span>" + productpromotionlist[i].Name + "</span>";
                    break;
                }
            }
        }