コード例 #1
0
ファイル: ProductDetails.cs プロジェクト: damoOnly/e-commerce
        protected override void AttachChildControls()
        {
            if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"]))
            {
                this.Page.Response.Redirect(System.Web.HttpContext.Current.Request.Url.ToString() + "&ReferralUserId=" + HiContext.Current.User.UserId);
                return;
            }
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound();
            }
            this.hiddenpid         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddenpid");
            this.hiddeSkuId        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeSkuId");
            this.hiddeCategoryId   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeCategoryId");
            this.hiddeCategoryName = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeCategoryName");
            this.hidCartQuantity   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txCartQuantity");
            this.hiddeProductCode  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeProductCode");
            this.hiddeUserId       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeUserId");
            this.hiddeProductName  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddeProductName");
            this.buyCardinality    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("buyCardinality");
            this.hiddenpid.Value   = this.productId.ToString();
            this.promote           = (ProductPromote)this.FindControl("ProductPromote");
            this.common_Location   = (Common_Location)this.FindControl("common_Location");
            this.litProductName    = (System.Web.UI.WebControls.Literal) this.FindControl("litProductName");
            this.lblProductCode    = (System.Web.UI.WebControls.Literal) this.FindControl("lblProductCode");
            this.lblSku            = (SkuLabel)this.FindControl("lblSku");
            this.lblStock          = (StockLabel)this.FindControl("lblStock");
            this.litUnit           = (System.Web.UI.WebControls.Literal) this.FindControl("litUnit");
            this.litBuyCardinality = (System.Web.UI.WebControls.Literal) this.FindControl("litBuyCardinality");
            this.litWeight         = (System.Web.UI.WebControls.Label) this.FindControl("litWeight");
            this.litBrosedNum      = (System.Web.UI.WebControls.Literal) this.FindControl("litBrosedNum");
            this.litBrand          = (System.Web.UI.WebControls.Literal) this.FindControl("litBrand");
            this.litSaleCounts     = (System.Web.UI.WebControls.Literal) this.FindControl("litSaleCounts");
            this.lblMarkerPrice    = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice");
            this.lblBuyPrice       = (System.Web.UI.WebControls.Label) this.FindControl("lblBuyPrice");
            this.lblsmalltitle     = (System.Web.UI.WebControls.Label) this.FindControl("lblsmalltitle");

            this.lblTotalPrice       = (TotalLabel)this.FindControl("lblTotalPrice");
            this.litDescription      = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.btnBuy                  = (BuyButton)this.FindControl("btnBuy");
            this.btnaddgouwu             = (AddCartButton)this.FindControl("btnaddgouwu");
            this.hpkProductConsultations = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductConsultations");
            this.hpkProductReviews       = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductReviews");
            this.hpkProductSales         = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductSales");
            this.litReviewCount          = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewCount");
            this.litItemNumber           = (System.Web.UI.WebControls.Literal) this.FindControl("litItemNumber");
            this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
            //this.rptExpandAttributes = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
            this.expandAttributes   = (Common_ExpandAttributes1)this.FindControl("expandAttributes");
            this.skuSelector        = (SKUSelector)this.FindControl("SKUSelector");
            this.reviews            = (Common_ProductReview)this.FindControl("list_Common_ProductReview");
            this.consultations      = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
            this.correlative        = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
            this.lbUserProductRefer = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.hidden_skus        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus");
            this.hidden_skuItem     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skuItem");
            this.litTaxRate         = (System.Web.UI.WebControls.Literal) this.FindControl("litTaxRate");
            this.imgIcon            = (HiImage)this.FindControl("imgIcon");
            this.litCnArea          = (System.Web.UI.WebControls.Literal) this.FindControl("litCnArea");
            this.litShipping        = (System.Web.UI.WebControls.Literal) this.FindControl("litShipping");
            this.hotSale            = (Common_GoodsList_HotSale)this.FindControl("list_Common_GoodsList_HotSale"); //销售排行
            this.litCategoryNotes3  = (System.Web.UI.WebControls.Literal) this.FindControl("litCategoryNotes3");
            this.productImg         = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("productImg");       //二维码图片
            this.nowBuyBtn          = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("nowBuyBtn");
            this.litviewcount       = (System.Web.UI.WebControls.Literal) this.FindControl("litviewcount");
            this.hiddensupplierid   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddensupplierid");
            this.litMarkPrice       = (System.Web.UI.WebControls.Literal) this.FindControl("litMarkPrice");
            this.txtBuyAmount       = (BuyAmountBox)this.FindControl("txtBuyAmount");
            if (!this.Page.IsPostBack)
            {
                ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, new int?(this.reviews.MaxNum), new int?(this.consultations.MaxNum));
                if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品已经被管理员删除"));
                    return;
                }
                if (this.hidCartQuantity != null)
                {
                    this.hidCartQuantity.Value = this.GetQuantity_Product(productBrowseInfo.Product.ProductId);
                }
                System.Collections.IEnumerable value =
                    from item in productBrowseInfo.Product.Skus
                    select item.Value;
                if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
                {
                    this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
                }
                if (this.hidden_skus != null)
                {
                    this.hidden_skus.Value = JsonConvert.SerializeObject(value);
                }
                if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
                {
                    this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("unproductdetails", new object[]
                    {
                        this.Page.Request.QueryString["productId"]
                    }));
                }
                if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库"));
                    return;
                }

                if (productBrowseInfo.cIsDisable == 1)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库"));
                    return;
                }


                this.LoadPageSearch(productBrowseInfo.Product);
                if (this.lbUserProductRefer != null)
                {
                    this.lbUserProductRefer.product = productBrowseInfo.Product;
                }
                this.hpkProductReviews.Text       = "查看全部" + productBrowseInfo.ReviewCount.ToString() + "条评论";
                this.litviewcount.Text            = productBrowseInfo.ReviewCount.ToString();
                this.hpkProductConsultations.Text = "查看全部" + productBrowseInfo.ConsultationCount.ToString() + "条咨询";
                string count = ProductBrowser.GetLineItemNumber(this.productId).ToString();
                //this.hpkProductSales.Text = "查看全部" + count + "条成交记录";

                int countt = ProductBrowser.GetLineItemCount(this.productId);
                if (countt > 0)
                {
                    this.hpkProductSales.Text        = "查看全部" + countt + "条成交记录";
                    this.hpkProductSales.NavigateUrl = string.Format("LookLineItems.aspx?productId={0}", this.productId);
                }
                else
                {
                    this.hpkProductSales.Text = "暂无成交记录";
                }

                this.litReviewCount.Text = productBrowseInfo.ReviewCount.ToString();
                this.litItemNumber.Text  = countt.ToString();
                this.hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", this.productId);
                this.hpkProductReviews.NavigateUrl       = string.Format("LookProductReviews.aspx?productId={0}", this.productId);
                //this.hpkProductSales.NavigateUrl = string.Format("LookLineItems.aspx?productId={0}", this.productId);
                this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);

                this.hiddeCategoryId.Value   = productBrowseInfo.CategoryId;
                this.hiddeCategoryName.Value = productBrowseInfo.CategoryName;
                this.hiddeProductName.Value  = productBrowseInfo.Product.ProductName;
                this.hiddeProductCode.Value  = productBrowseInfo.Product.ProductCode;
                this.hiddeUserId.Value       = HiContext.Current.User.UserId.ToString();
                this.btnBuy.Stock            = productBrowseInfo.Product.Stock;
                this.txtBuyAmount.Quantity   = productBrowseInfo.Product.BuyCardinality;
                this.btnaddgouwu.Stock       = productBrowseInfo.Product.Stock;
                BrowsedProductQueue.EnQueue(this.productId);
                this.images.ImageInfo = productBrowseInfo.Product;
                if (this.promote != null)
                {
                    this.promote.ProductId = this.productId;
                }
                if (productBrowseInfo.DbAttribute != null)
                {
                    this.expandAttributes.DbAttribute = productBrowseInfo.DbAttribute;//商品扩展属性
                    //this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
                    //this.rptExpandAttributes.DataBind();
                }
                if (productBrowseInfo.DbSKUs != null)
                {
                    this.skuSelector.ProductId  = this.productId;
                    this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
                }
                if (productBrowseInfo.DBReviews != null)
                {
                    this.reviews.DataSource = productBrowseInfo.DBReviews;
                    this.reviews.DataBind();
                }
                if (productBrowseInfo.DBConsultations != null)
                {
                    this.consultations.DataSource = productBrowseInfo.DBConsultations;
                    this.consultations.DataBind();
                }
                if (productBrowseInfo.DbCorrelatives != null)
                {
                    this.correlative.DataSource = productBrowseInfo.DbCorrelatives;//推荐 ,捆绑或同类型下的商品
                    this.correlative.DataBind();
                }
                if (productBrowseInfo.DBHotSale != null)
                {
                    this.hotSale.DataSource = productBrowseInfo.DBHotSale;
                    this.hotSale.DataBind();
                }
                if (this.productImg != null)
                {
                    if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.QRcode))
                    {
                        this.productImg.Src = productBrowseInfo.Product.QRcode;
                    }
                    //else
                    //{
                    //    //this.productImg.Attributes.Add("display", "none");
                    //}
                }
                this.litCategoryNotes3.Text = productBrowseInfo.CategoryNote3;
            }
        }
コード例 #2
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.common_Location         = (Common_Location)this.FindControl("common_Location");
     this.litProductName          = (Literal)this.FindControl("litProductName");
     this.lblProductCode          = (Literal)this.FindControl("lblProductCode");
     this.lblSku                  = (SkuLabel)this.FindControl("lblSku");
     this.lblStock                = (StockLabel)this.FindControl("lblStock");
     this.litUnit                 = (Literal)this.FindControl("litUnit");
     this.litWeight               = (Label)this.FindControl("litWeight");
     this.litBrosedNum            = (Literal)this.FindControl("litBrosedNum");
     this.litBrand                = (Literal)this.FindControl("litBrand");
     this.lblMarkerPrice          = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice");
     this.lblBuyPrice             = (Label)this.FindControl("lblBuyPrice");
     this.lblTotalPrice           = (TotalLabel)this.FindControl("lblTotalPrice");
     this.litDescription          = (Literal)this.FindControl("litDescription");
     this.litShortDescription     = (Literal)this.FindControl("litShortDescription");
     this.hpkProductConsultations = (HyperLink)this.FindControl("hpkProductConsultations");
     this.hpkProductReviews       = (HyperLink)this.FindControl("hpkProductReviews");
     this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
     this.rptExpandAttributes     = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
     this.skuSelector             = (SKUSelector)this.FindControl("SKUSelector");
     this.reviews                 = (Common_ProductReview)this.FindControl("list_Common_ProductReview");
     this.consultations           = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
     this.correlative             = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
     if (!this.Page.IsPostBack)
     {
         int maxNum = 0;
         if (this.reviews != null)
         {
             maxNum = this.reviews.MaxNum;
         }
         int num2 = 0;
         if (this.consultations != null)
         {
             num2 = this.consultations.MaxNum;
         }
         ProductBrowseInfo info = ProductBrowser.GetProductBrowseInfo(this.productId, new int?(maxNum), new int?(num2));
         if ((info.Product == null) || (info.Product.SaleStatus == ProductSaleStatus.Delete))
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品已经被管理员删除"));
         }
         else if (info.Product.SaleStatus == ProductSaleStatus.OnSale)
         {
             Globals.GetSiteUrls().UrlData.FormatUrl("productdetails", new object[] { this.Page.Request.QueryString["productId"] });
         }
         else
         {
             this.LoadPageSearch(info.Product);
             if (this.hpkProductReviews != null)
             {
                 this.hpkProductReviews.Text        = "查看全部" + ProductBrowser.GetProductReviewNumber(this.productId).ToString() + "条评论";
                 this.hpkProductReviews.NavigateUrl = string.Format("LookProductReviews.aspx?productId={0}", this.productId);
             }
             if (this.hpkProductConsultations != null)
             {
                 this.hpkProductConsultations.Text        = "查看全部" + ProductBrowser.GetProductConsultationNumber(this.productId).ToString() + "条咨询";
                 this.hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", this.productId);
             }
             this.LoadProductInfo(info.Product, info.BrandName);
             BrowsedProductQueue.EnQueue(this.productId);
             this.images.ImageInfo = info.Product;
             if (info.DbAttribute != null)
             {
                 this.rptExpandAttributes.DataSource = info.DbAttribute;
                 this.rptExpandAttributes.DataBind();
             }
             if (info.DbSKUs != null)
             {
                 this.skuSelector.ProductId  = this.productId;
                 this.skuSelector.DataSource = info.DbSKUs;
             }
             if ((this.reviews != null) && (info.DBReviews != null))
             {
                 this.reviews.DataSource = info.DBReviews;
                 this.reviews.DataBind();
             }
             if ((this.consultations != null) && (info.DBConsultations != null))
             {
                 this.consultations.DataSource = info.DBConsultations;
                 this.consultations.DataBind();
             }
             if ((this.correlative != null) && (info.DbCorrelatives != null))
             {
                 this.correlative.DataSource = info.DbCorrelatives;
                 this.correlative.DataBind();
             }
         }
     }
 }
コード例 #3
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.common_Location         = (Common_Location)this.FindControl("common_Location");
     this.litProductName          = (System.Web.UI.WebControls.Literal) this.FindControl("litProductName");
     this.lblSku                  = (SkuLabel)this.FindControl("lblSku");
     this.lblStock                = (StockLabel)this.FindControl("lblStock");
     this.litUnit                 = (System.Web.UI.WebControls.Literal) this.FindControl("litUnit");
     this.litWeight               = (System.Web.UI.WebControls.Label) this.FindControl("litWeight");
     this.litBrosedNum            = (System.Web.UI.WebControls.Literal) this.FindControl("litBrosedNum");
     this.litBrand                = (System.Web.UI.WebControls.Literal) this.FindControl("litBrand");
     this.litContent              = (System.Web.UI.WebControls.Literal) this.FindControl("litContent");
     this.lblSalePrice            = (FormatedMoneyLabel)this.FindControl("lblSalePrice");
     this.lblTotalPrice           = (TotalLabel)this.FindControl("lblTotalPrice");
     this.litDescription          = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
     this.litShortDescription     = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
     this.btnOrder                = (BuyButton)this.FindControl("btnOrder");
     this.hpkProductConsultations = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductConsultations");
     this.hpkProductReviews       = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductReviews");
     this.txtMaxCount             = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtMaxCount");
     this.txtSoldCount            = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtSoldCount");
     this.lblCurrentSalePrice     = (FormatedMoneyLabel)this.FindControl("lblCurrentSalePrice");
     this.litCount                = (System.Web.UI.WebControls.Label) this.FindControl("litCount");
     this.lblNeedPrice            = (FormatedMoneyLabel)this.FindControl("lblNeedPrice");
     this.lblEndTime              = (FormatedTimeLabel)this.FindControl("lblEndTime");
     this.lblStartTime            = (FormatedTimeLabel)this.FindControl("lblStartTime");
     this.litRemainTime           = (System.Web.UI.WebControls.Literal) this.FindControl("litRemainTime");
     this.litNeedCount            = (System.Web.UI.WebControls.Literal) this.FindControl("litNeedCount");
     this.litMaxCount             = (System.Web.UI.WebControls.Label) this.FindControl("litMaxCount");
     this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
     this.rptExpandAttributes     = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
     this.skuSelector             = (SKUSelector)this.FindControl("SKUSelector");
     this.reviews                 = (Common_ProductReview)this.FindControl("list_Common_ProductReview");
     this.consultations           = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
     this.correlative             = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
     this.nowTime                 = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("nowTime");
     this.nowTime.SetWhenIsNotNull(System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo));
     this.hidden_skus    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus");
     this.hidden_skuItem = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skuItem");
     if (!this.Page.IsPostBack)
     {
         ProductBrowseInfo productBrowseInfo   = ProductBrowser.GetProductBrowseInfo(this.productId, new int?(this.reviews.MaxNum), new int?(this.consultations.MaxNum));
         GroupBuyInfo      productGroupBuyInfo = ProductBrowser.GetProductGroupBuyInfo(this.productId);
         if (productBrowseInfo.Product == null || productGroupBuyInfo == null)
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品参与的团购活动已经结束;或已被管理员删除"));
             return;
         }
         System.Collections.IEnumerable value =
             from item in productBrowseInfo.Product.Skus
             select item.Value;
         if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
         {
             this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
         }
         if (this.hidden_skus != null)
         {
             this.hidden_skus.Value = JsonConvert.SerializeObject(value);
         }
         this.LoadPageSearch(productBrowseInfo.Product);
         this.hpkProductReviews.Text              = "查看全部" + productBrowseInfo.ReviewCount.ToString() + "条评论";
         this.hpkProductConsultations.Text        = "查看全部" + productBrowseInfo.ConsultationCount.ToString() + "条咨询";
         this.hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", this.productId);
         this.hpkProductReviews.NavigateUrl       = string.Format("LookProductReviews.aspx?productId={0}", this.productId);
         this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);
         this.LoadProductGroupBuyInfo(productGroupBuyInfo);
         this.btnOrder.Stock = productBrowseInfo.Product.Stock;
         BrowsedProductQueue.EnQueue(this.productId);
         this.images.ImageInfo = productBrowseInfo.Product;
         this.litContent.Text  = productGroupBuyInfo.Content;
         if (productBrowseInfo.DbAttribute != null)
         {
             this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
             this.rptExpandAttributes.DataBind();
         }
         if (productBrowseInfo.DbSKUs != null)
         {
             this.skuSelector.ProductId  = this.productId;
             this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
         }
         if (productBrowseInfo.DBReviews != null)
         {
             this.reviews.DataSource = productBrowseInfo.DBReviews;
             this.reviews.DataBind();
         }
         if (productBrowseInfo.DBConsultations != null)
         {
             this.consultations.DataSource = productBrowseInfo.DBConsultations;
             this.consultations.DataBind();
         }
         if (productBrowseInfo.DbCorrelatives != null)
         {
             this.correlative.DataSource = productBrowseInfo.DbCorrelatives;
             this.correlative.DataBind();
         }
     }
 }
コード例 #4
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.common_Location         = (Common_Location)this.FindControl("common_Location");
     this.litProductCode          = (Literal)this.FindControl("litProductCode");
     this.litProductName          = (Literal)this.FindControl("litProductName");
     this.lblSku                  = (SkuLabel)this.FindControl("lblSku");
     this.lblStock                = (StockLabel)this.FindControl("lblStock");
     this.litUnit                 = (Literal)this.FindControl("litUnit");
     this.litWeight               = (WeightLabel)this.FindControl("litWeight");
     this.litBrosedNum            = (Literal)this.FindControl("litBrosedNum");
     this.litBrand                = (Literal)this.FindControl("litBrand");
     this.lblSalePrice            = (FormatedMoneyLabel)this.FindControl("lblSalePrice");
     this.lblTotalPrice           = (TotalLabel)this.FindControl("lblTotalPrice");
     this.litDescription          = (Literal)this.FindControl("litDescription");
     this.litShortDescription     = (Literal)this.FindControl("litShortDescription");
     this.btnOrder                = (BuyButton)this.FindControl("btnOrder");
     this.hpkProductConsultations = (HyperLink)this.FindControl("hpkProductConsultations");
     this.hpkProductReviews       = (HyperLink)this.FindControl("hpkProductReviews");
     this.lblCurrentSalePrice     = (FormatedMoneyLabel)this.FindControl("lblCurrentSalePrice");
     this.litContent              = (Literal)this.FindControl("litContent");
     this.lblEndTime              = (FormatedTimeLabel)this.FindControl("lblEndTime");
     this.litRemainTime           = (Literal)this.FindControl("litRemainTime");
     this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
     this.rptExpandAttributes     = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
     this.skuSelector             = (SKUSelector)this.FindControl("SKUSelector");
     this.reviews                 = (Common_ProductReview)this.FindControl("list_Common_ProductReview");
     this.consultations           = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
     this.correlative             = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
     if (!this.Page.IsPostBack)
     {
         ProductBrowseInfo info          = ProductBrowser.GetProductBrowseInfo(this.productId, new int?(this.reviews.MaxNum), new int?(this.consultations.MaxNum));
         CountDownInfo     countDownInfo = ProductBrowser.GetCountDownInfo(this.productId);
         if ((info.Product == null) || (countDownInfo == null))
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品参与的限时抢购活动已经结束;或被管理员删除"));
         }
         else
         {
             this.LoadPageSearch(info.Product);
             this.hpkProductReviews.Text              = "查看全部" + ProductBrowser.GetProductReviewNumber(this.productId).ToString() + "条评论";
             this.hpkProductConsultations.Text        = "查看全部" + ProductBrowser.GetProductConsultationNumber(this.productId).ToString() + "条咨询";
             this.hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", this.productId);
             this.hpkProductReviews.NavigateUrl       = string.Format("LookProductReviews.aspx?productId={0}", this.productId);
             this.LoadProductInfo(info.Product, info.BrandName);
             this.LoadProductGroupBuyInfo(countDownInfo);
             this.btnOrder.Stock = info.Product.Stock;
             BrowsedProductQueue.EnQueue(this.productId);
             this.images.ImageInfo = info.Product;
             if (info.DbAttribute != null)
             {
                 this.rptExpandAttributes.DataSource = info.DbAttribute;
                 this.rptExpandAttributes.DataBind();
             }
             if (info.DbSKUs != null)
             {
                 this.skuSelector.ProductId  = this.productId;
                 this.skuSelector.DataSource = info.DbSKUs;
             }
             if (info.DBReviews != null)
             {
                 this.reviews.DataSource = info.DBReviews;
                 this.reviews.DataBind();
             }
             if (info.DBConsultations != null)
             {
                 this.consultations.DataSource = info.DBConsultations;
                 this.consultations.DataBind();
             }
             if (info.DbCorrelatives != null)
             {
                 this.correlative.DataSource = info.DbCorrelatives;
                 this.correlative.DataBind();
             }
         }
     }
 }
コード例 #5
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(Page.Request.QueryString["productId"], out productId))
     {
         base.GotoResourceNotFound();
     }
     common_Location         = (Common_Location)FindControl("common_Location");
     litProductName          = (Literal)FindControl("litProductName");
     lblProductCode          = (Literal)FindControl("lblProductCode");
     lblSku                  = (SkuLabel)FindControl("lblSku");
     lblStock                = (StockLabel)FindControl("lblStock");
     litUnit                 = (Literal)FindControl("litUnit");
     litWeight               = (WeightLabel)FindControl("litWeight");
     litBrosedNum            = (Literal)FindControl("litBrosedNum");
     litBrand                = (Literal)FindControl("litBrand");
     litSaleCounts           = (Literal)FindControl("litSaleCounts");
     lblMarkerPrice          = (FormatedMoneyLabel)FindControl("lblMarkerPrice");
     lblBuyPrice             = (Label)FindControl("lblBuyPrice");
     lblTotalPrice           = (TotalLabel)FindControl("lblTotalPrice");
     litDescription          = (Literal)FindControl("litDescription");
     litShortDescription     = (Literal)FindControl("litShortDescription");
     btnBuy                  = (BuyButton)FindControl("btnBuy");
     btnaddgouwu             = (AddCartButton)FindControl("btnaddgouwu");
     hpkProductConsultations = (HyperLink)FindControl("hpkProductConsultations");
     hpkProductReviews       = (HyperLink)FindControl("hpkProductReviews");
     images                  = (Common_ProductImages)FindControl("common_ProductImages");
     rptExpandAttributes     = (ThemedTemplatedRepeater)FindControl("rptExpandAttributes");
     skuSelector             = (SKUSelector)FindControl("SKUSelector");
     reviews                 = (Common_ProductReview)FindControl("list_Common_ProductReview");
     consultations           = (Common_ProductConsultations)FindControl("list_Common_ProductConsultations");
     correlative             = (Common_GoodsList_Correlative)FindControl("list_Common_GoodsList_Correlative");
     if (!Page.IsPostBack)
     {
         ProductBrowseInfo info = ProductBrowser.GetProductBrowseInfo(productId, new int?(reviews.MaxNum), new int?(consultations.MaxNum));
         if ((info.Product == null) || (info.Product.SaleStatus == ProductSaleStatus.Delete))
         {
             Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品已经被管理员删除"));
         }
         else
         {
             if (info.Product.SaleStatus == ProductSaleStatus.UnSale)
             {
                 Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("unproductdetails", new object[] { Page.Request.QueryString["productId"] }));
             }
             LoadPageSearch(info.Product);
             hpkProductReviews.Text              = "查看全部" + ProductBrowser.GetProductReviewNumber(productId).ToString() + "条评论";
             hpkProductConsultations.Text        = "查看全部" + ProductBrowser.GetProductConsultationNumber(productId).ToString() + "条咨询";
             hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", productId);
             hpkProductReviews.NavigateUrl       = string.Format("LookProductReviews.aspx?productId={0}", productId);
             LoadProductInfo(info.Product, info.BrandName);
             btnBuy.Stock      = info.Product.Stock;
             btnaddgouwu.Stock = info.Product.Stock;
             BrowsedProductQueue.EnQueue(productId);
             images.ImageInfo = info.Product;
             if (info.DbAttribute != null)
             {
                 rptExpandAttributes.DataSource = info.DbAttribute;
                 rptExpandAttributes.DataBind();
             }
             if (info.DbSKUs != null)
             {
                 skuSelector.ProductId  = productId;
                 skuSelector.DataSource = info.DbSKUs;
             }
             if (info.DBReviews != null)
             {
                 reviews.DataSource = info.DBReviews;
                 reviews.DataBind();
             }
             if (info.DBConsultations != null)
             {
                 consultations.DataSource = info.DBConsultations;
                 consultations.DataBind();
             }
             if (info.DbCorrelatives != null)
             {
                 correlative.DataSource = info.DbCorrelatives;
                 correlative.DataBind();
             }
         }
     }
 }
コード例 #6
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.common_Location         = (Common_Location)this.FindControl("common_Location");
     this.litProductName          = (System.Web.UI.WebControls.Literal) this.FindControl("litProductName");
     this.lblProductCode          = (System.Web.UI.WebControls.Literal) this.FindControl("lblProductCode");
     this.lblSku                  = (SkuLabel)this.FindControl("lblSku");
     this.lblStock                = (StockLabel)this.FindControl("lblStock");
     this.litUnit                 = (System.Web.UI.WebControls.Literal) this.FindControl("litUnit");
     this.litWeight               = (System.Web.UI.WebControls.Label) this.FindControl("litWeight");
     this.litBrosedNum            = (System.Web.UI.WebControls.Literal) this.FindControl("litBrosedNum");
     this.litBrand                = (System.Web.UI.WebControls.Literal) this.FindControl("litBrand");
     this.lblMarkerPrice          = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice");
     this.lblBuyPrice             = (System.Web.UI.WebControls.Label) this.FindControl("lblBuyPrice");
     this.lblTotalPrice           = (TotalLabel)this.FindControl("lblTotalPrice");
     this.litDescription          = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
     this.litShortDescription     = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
     this.hpkProductConsultations = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductConsultations");
     this.hpkProductReviews       = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductReviews");
     this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
     this.rptExpandAttributes     = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
     this.skuSelector             = (SKUSelector)this.FindControl("SKUSelector");
     this.reviews                 = (Common_ProductReview)this.FindControl("list_Common_ProductReview");
     this.consultations           = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
     this.correlative             = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
     this.hidden_skus             = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus");
     this.hidden_skuItem          = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skuItem");
     this.hidCartQuantity         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txCartQuantity");
     this.litIsDown               = (System.Web.UI.WebControls.Literal) this.FindControl("litIsDown");
     this.litTaxRate              = (System.Web.UI.WebControls.Literal) this.FindControl("litTaxRate");
     if (!this.Page.IsPostBack)
     {
         int value = 0;
         if (this.reviews != null)
         {
             value = this.reviews.MaxNum;
         }
         int value2 = 0;
         if (this.consultations != null)
         {
             value2 = this.consultations.MaxNum;
         }
         ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, new int?(value), new int?(value2));
         if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品已经被管理员删除"));
             return;
         }
         if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnSale)
         {
             Globals.GetSiteUrls().UrlData.FormatUrl("productdetails", new object[]
             {
                 this.Page.Request.QueryString["productId"]
             });
             return;
         }
         if (this.hidCartQuantity != null)
         {
             this.hidCartQuantity.Value = "0";
         }
         System.Collections.IEnumerable value3 =
             from item in productBrowseInfo.Product.Skus
             select item.Value;
         if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
         {
             this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
         }
         if (this.hidden_skus != null)
         {
             this.hidden_skus.Value = JsonConvert.SerializeObject(value3);
         }
         this.LoadPageSearch(productBrowseInfo.Product);
         if (this.hpkProductReviews != null)
         {
             this.hpkProductReviews.Text        = "查看全部" + productBrowseInfo.ReviewCount.ToString() + "条评论";
             this.hpkProductReviews.NavigateUrl = string.Format("LookProductReviews.aspx?productId={0}", this.productId);
         }
         if (this.hpkProductConsultations != null)
         {
             this.hpkProductConsultations.Text        = "查看全部" + productBrowseInfo.ConsultationCount.ToString() + "条咨询";
             this.hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", this.productId);
         }
         this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);
         BrowsedProductQueue.EnQueue(this.productId);
         this.images.ImageInfo = productBrowseInfo.Product;
         if (productBrowseInfo.DbAttribute != null)
         {
             this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
             this.rptExpandAttributes.DataBind();
         }
         if (productBrowseInfo.DbSKUs != null)
         {
             this.skuSelector.ProductId  = this.productId;
             this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
         }
         if (this.reviews != null && productBrowseInfo.DBReviews != null)
         {
             this.reviews.DataSource = productBrowseInfo.DBReviews;
             this.reviews.DataBind();
         }
         if (this.consultations != null && productBrowseInfo.DBConsultations != null)
         {
             this.consultations.DataSource = productBrowseInfo.DBConsultations;
             this.consultations.DataBind();
         }
         if (this.correlative != null && productBrowseInfo.DbCorrelatives != null)
         {
             this.correlative.DataSource = productBrowseInfo.DbCorrelatives;
             this.correlative.DataBind();
         }
         if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
         {
             if (this.litIsDown != null)
             {
                 this.litIsDown.Text = "该商品已经下架";
             }
         }
     }
 }