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.lblSku.Text = productDetails.SKU; this.lblSku.Value = productDetails.SkuId; this.litProductName.Text = productDetails.ProductName; int num; if (!this.sitesettings.OpenMultStore) { this.lblStock.Stock = productDetails.Stock; this.litUnit.Text = productDetails.Unit; this.hidIsOpenMultiStore.Value = "0"; } else { this.lblStock.Stock = productDetails.DefaultSku.Stock; StockLabel stockLabel = this.lblStock; num = productDetails.Stock; stockLabel.ShowText = num.ToString(); this.litUnit.Visible = false; this.hidIsOpenMultiStore.Value = "1"; } if (this.litSaleCounts != null) { Literal literal = this.litSaleCounts; num = productDetails.ShowSaleCounts; literal.Text = num.ToString(); } if (productDetails.MinSalePrice == productDetails.MaxSalePrice) { this.lblBuyPrice.Text = productDetails.MinSalePrice.F2ToString("f2"); this.lblTotalPrice.Value = productDetails.MinSalePrice; } else { this.lblBuyPrice.Text = productDetails.MinSalePrice.F2ToString("f2") + " - " + productDetails.MaxSalePrice.F2ToString("f2"); } this.litDescription.Text = productDetails.Description; if (this.litDescription != null) { string text = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex.Replace(productDetails.Description, ""); } text = text.Replace("src", "data-url"); this.litDescription.Text = text; } if (this.litShortDescription != null) { this.litShortDescription.Text = productDetails.ShortDescription; } }
protected override void AttachChildControls() { if (!int.TryParse(base.GetParameter("productId", false), out this.productId)) { base.GotoResourceNotFound(); } this.hiddenpid = (HtmlInputHidden)this.FindControl("hiddenpid"); this.hidCartQuantity = (HtmlInputHidden)this.FindControl("txCartQuantity"); this.hiddenpid.Value = this.productId.ToString(); this.common_Location = (Common_Location)this.FindControl("common_Location"); this.litProductName = (Literal)this.FindControl("litProductName"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.litSaleCounts = (Literal)this.FindControl("litSaleCounts"); this.lblMarkerPrice = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice"); this.lblBuyPrice = (Label)this.FindControl("lblBuyPrice"); this.lblTotalPrice = (TotalLabel)this.FindControl("lblTotalPrice"); this.lblSku = (SkuLabel)this.FindControl("lblSku"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.btnBuy = (BuyButton)this.FindControl("btnBuy"); this.btnaddgouwu = (AddCartButton)this.FindControl("btnaddgouwu"); this.hpkProductConsultations = (HyperLink)this.FindControl("hpkProductConsultations"); this.ltlSaleCount = (Literal)this.FindControl("ltlSaleCount"); this.ltlReviewCount = (Literal)this.FindControl("ltlReviewCount"); this.litReviewCount = (Literal)this.FindControl("litReviewCount"); this.ltlConsultation = (Literal)this.FindControl("ltlConsultation"); this.images = (Common_ProductImages)this.FindControl("common_ProductImages"); this.rptExpandAttributes = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes"); this.rptOnlineService = (ThemedTemplatedRepeater)this.FindControl("rptOnlineService"); this.skuSelector = (SKUSelector)this.FindControl("SKUSelector"); 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 = (HtmlInputHidden)this.FindControl("hidden_skus"); this.hidden_skuItem = (HtmlInputHidden)this.FindControl("hidden_skuItem"); this.hidIsOpenMultiStore = (HtmlInputHidden)this.FindControl("hidIsOpenMultiStore"); this.aCountDownUrl = (HyperLink)this.FindControl("aCountDownUrl"); this.imgQrCode = (Image)this.FindControl("imgQrCode"); this.phonePriceQrCode = (Image)this.FindControl("phonePriceQrCode"); this.liCode = (HtmlGenericControl)this.FindControl("liCode"); this.hidden_productId = (HtmlInputHidden)this.FindControl("hidden_productId"); this.hidHasStores = (HtmlInputHidden)this.FindControl("hidHasStores"); this.divGift = (HtmlGenericControl)this.FindControl("divGift"); this.ltlGiftName = (Literal)this.FindControl("ltlGiftName"); this.ltlGiftNum = (Literal)this.FindControl("ltlGiftNum"); this.aBrand = (HtmlAnchor)this.FindControl("aBrand"); this.imgBrand = (HiImage)this.FindControl("imgBrand"); this.imgCustomerService = (HtmlImage)this.FindControl("imgCustomerService"); this.ltlOrderPromotion = (Literal)this.FindControl("ltlOrderPromotion"); this.divOrderPromotions = (HtmlGenericControl)this.FindControl("divOrderPromotions"); this.divPhonePrice = (HtmlGenericControl)this.FindControl("divPhonePrice"); this.litPhonePrice = (Literal)this.FindControl("litPhonePrice"); this.litPhonePriceEndDate = (Literal)this.FindControl("litPhonePriceEndDate"); this.divCuxiao = (HtmlGenericControl)this.FindControl("divCuxiao"); this.ltlUnit = (Literal)this.FindControl("ltlUnit"); this.divProductReferral = (HtmlGenericControl)this.FindControl("divProductReferral"); this.ltlProductSendGifts = (Literal)this.FindControl("ltlProductSendGifts"); this.setDeliverRegion = (Common_SetDeliveryRegion)this.FindControl("setDeliverRegion"); this.hidShowCombinationBuy = (HtmlInputHidden)this.FindControl("hidShowCombinationBuy"); this.hidCombinationId = (HtmlInputHidden)this.FindControl("hidCombinationId"); this.imgMainPic = (HtmlImage)this.FindControl("imgMainPic"); this.divqq = (HtmlGenericControl)this.FindControl("divqq"); HtmlAnchor htmlAnchor = (HtmlAnchor)this.FindControl("aMainName"); this.lblMainPrice = (Label)this.FindControl("lblMainPrice"); ThemedTemplatedRepeater themedTemplatedRepeater = (ThemedTemplatedRepeater)this.FindControl("rptOtherProducts"); this.aCountDownUrl.Visible = false; if (this.Page.IsPostBack) { return; } if (this.imgQrCode != null) { string text = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png"; Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text, false, ImageFormats.Png); this.imgQrCode.ImageUrl = text; } if (this.phonePriceQrCode != null) { string text2 = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png"; Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text2, false, ImageFormats.Png); this.phonePriceQrCode.ImageUrl = text2; } if (this.liCode != null && HiContext.Current.SiteSettings.OpenAliho == 0 && HiContext.Current.SiteSettings.OpenVstore == 0 && HiContext.Current.SiteSettings.OpenWap == 0 && HiContext.Current.SiteSettings.OpenMobbile == 0) { this.liCode.Visible = false; } ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, this.sitesettings.OpenMultStore, 0); if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("/ProductDelete.aspx"); return; } if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnSale && productBrowseInfo.Product.AuditStatus == ProductAuditStatus.Pass) { this.Page.Response.Redirect(base.GetRouteUrl("productdetails", new { ProductId = this.productId })); } this.setDeliverRegion.ShippingTemplateId = productBrowseInfo.Product.ShippingTemplateId; this.setDeliverRegion.Volume = productBrowseInfo.Product.Weight; this.setDeliverRegion.Weight = productBrowseInfo.Product.Weight; if (this.hidCartQuantity != null) { this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(productBrowseInfo.Product.ProductId); } 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.hidden_productId.Value = this.productId.ToString(); this.LoadPageSearch(productBrowseInfo.Product); if (this.lbUserProductRefer != null && this.sitesettings.OpenReferral == 1 && this.sitesettings.ShowDeductInProductPage) { this.lbUserProductRefer.product = productBrowseInfo.Product; } HyperLink hyperLink = this.hpkProductConsultations; int num = productBrowseInfo.ConsultationCount; hyperLink.Text = "查看全部" + num.ToString() + "条咨询"; Literal literal = this.ltlConsultation; num = productBrowseInfo.ConsultationCount; literal.Text = num.ToString(); Literal literal2 = this.ltlSaleCount; num = productBrowseInfo.SaleCount; literal2.Text = num.ToString(); Literal literal3 = this.ltlReviewCount; num = productBrowseInfo.ReviewCount; literal3.Text = num.ToString(); Literal literal4 = this.litReviewCount; num = productBrowseInfo.ReviewCount; literal4.Text = num.ToString(); this.hpkProductConsultations.NavigateUrl = $"ProductConsultationsAndReplay.aspx?productId={this.productId}"; this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName); this.btnBuy.Stock = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock); this.btnBuy.Visible = false; this.ltlUnit.Text = productBrowseInfo.Product.Unit; this.divqq.Visible = (this.sitesettings.ServiceIsOpen == "1"); MemberInfo user = HiContext.Current.User; if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productBrowseInfo.Product.SubMemberDeduct.HasValue)) { if (!productBrowseInfo.Product.SubMemberDeduct.HasValue) { goto IL_0acd; } decimal?subMemberDeduct = productBrowseInfo.Product.SubMemberDeduct; if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue) { goto IL_0acd; } } goto IL_0af3; IL_0af3: int num2 = 1; goto IL_0af4; IL_0acd: if (HiContext.Current.SiteSettings.OpenReferral == 1) { num2 = ((!HiContext.Current.SiteSettings.ShowDeductInProductPage) ? 1 : 0); goto IL_0af4; } goto IL_0af3; IL_0af4: if (num2 != 0) { this.divProductReferral.Visible = false; } this.btnaddgouwu.Stock = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock); this.btnaddgouwu.Visible = false; 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 (productBrowseInfo.Product.BrandId.HasValue) { BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value); if (brandCategory != null && !string.IsNullOrEmpty(brandCategory.Logo)) { this.imgBrand.ImageUrl = brandCategory.Logo; this.aBrand.HRef = base.GetRouteUrl("branddetails", new { brandId = brandCategory.BrandId }); } } if (productBrowseInfo.DBConsultations != null) { this.consultations.DataSource = productBrowseInfo.DBConsultations; this.consultations.DataBind(); } if (productBrowseInfo.DbCorrelatives != null) { this.correlative.DataSource = productBrowseInfo.DbCorrelatives; this.correlative.DataBind(); } this.BindOrderPromotions(); string productPromotionsInfo = this.GetProductPromotionsInfo(); this.ltlProductSendGifts.Text = productPromotionsInfo; if (!this.divOrderPromotions.Visible && productPromotionsInfo == string.Empty) { this.divCuxiao.Style.Add("display", "none"); } if (this.rptOnlineService != null) { IList <OnlineServiceInfo> allOnlineService = OnlineServiceHelper.GetAllOnlineService(0, 1); IList <OnlineServiceInfo> allOnlineService2 = OnlineServiceHelper.GetAllOnlineService(0, 2); if (allOnlineService2 != null) { foreach (OnlineServiceInfo item in allOnlineService2) { allOnlineService.Add(item); } } this.rptOnlineService.DataSource = allOnlineService; this.rptOnlineService.DataBind(); } }
protected override void AttachChildControls() { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { this.ShowWapMessage("错误的商品ID", "Default.aspx"); } if (base.ClientType.Equals(ClientType.VShop)) { FightGroupActivitiyModel fightGroupActivitiyModel = VShopHelper.GetFightGroupActivities(new FightGroupActivitiyQuery { PageIndex = 1, PageSize = 1, ProductId = this.productId, Status = EnumFightGroupActivitiyStatus.BeingCarried }).Models.FirstOrDefault(); if (fightGroupActivitiyModel != null) { this.Page.Response.Redirect("FightGroupActivityDetails.aspx?fightGroupActivityId=" + fightGroupActivitiyModel.FightGroupActivityId); } } this.hidStoreId = (HtmlInputHidden)this.FindControl("hidStoreId"); this.hidSupplier = (HtmlInputHidden)this.FindControl("hidSupplier"); this.litSupplierName = (Literal)this.FindControl("litSupplierName"); this.aCountDownUrl = (HyperLink)this.FindControl("aCountDownUrl"); this.aCountDownUrl.Visible = false; this.divCountDownUrl = (HtmlGenericControl)this.FindControl("divCountDownUrl"); this.hidCanTakeOnStore = (HtmlInputHidden)this.FindControl("hidCanTakeOnStore"); this.HasActivitiesToJumpUrl(); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.rptCouponList = (WapTemplatedRepeater)this.FindControl("rptCouponList"); this.rp_guest = (WapTemplatedRepeater)this.FindControl("rp_guest"); this.rp_com = (WapTemplatedRepeater)this.FindControl("rp_com"); this.litProdcutName = (Literal)this.FindControl("litProdcutName"); this.litSalePrice = (Literal)this.FindControl("litSalePrice"); this.litMarketPrice = (Literal)this.FindControl("litMarketPrice"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litDescription = (Literal)this.FindControl("litDescription"); this.ltlcombinamaininfo = (Literal)this.FindControl("ltlcombinamaininfo"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.skuStoreSubmitOrder = (Common_SKUSubmitStoreOrder)this.FindControl("skuStoreSubmitOrder"); this.expandAttr = (Common_ExpandAttributes)this.FindControl("ExpandAttributes"); this.litSoldCount = (Literal)this.FindControl("litSoldCount"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litReviewsCount = (Literal)this.FindControl("litReviewsCount"); this.litHasCollected = (HtmlInputHidden)this.FindControl("litHasCollected"); this.hidden_skus = (HtmlInputHidden)this.FindControl("hidden_skus"); this.ltlOrderPromotion = (Literal)this.FindControl("ltlOrderPromotion"); this.ltlOrderPromotion2 = (Literal)this.FindControl("ltlOrderPromotion2"); this.ltlProductSendGifts2 = (Literal)this.FindControl("ltlProductSendGifts2"); this.ltlProductSendGifts = (Literal)this.FindControl("ltlProductSendGifts"); this.liOrderPromotions = (HtmlGenericControl)this.FindControl("liOrderPromotions"); this.liOrderPromotions2 = (HtmlGenericControl)this.FindControl("liOrderPromotions2"); this.liProductSendGifts2 = (HtmlGenericControl)this.FindControl("liProductSendGifts2"); this.liOrderPromotions_free2 = (HtmlGenericControl)this.FindControl("liOrderPromotions_free2"); this.liOrderPromotions_free = (HtmlGenericControl)this.FindControl("liOrderPromotions_free"); this.divActivities = (HtmlGenericControl)this.FindControl("divActivities"); this.ltlOrderPromotion_free2 = (Literal)this.FindControl("ltlOrderPromotion_free2"); this.ltlOrderPromotion_free = (Literal)this.FindControl("ltlOrderPromotion_free"); this.liProductSendGifts = (HtmlGenericControl)this.FindControl("liProductSendGifts"); this.lbUserProductRefer = (UserProductReferLabel)this.FindControl("lbUserProductRefer"); this.divshiptoregion = (HtmlGenericControl)this.FindControl("divshiptoregion"); this.divwaplocateaddress = (HtmlGenericControl)this.FindControl("divwaplocateaddress"); this.promote = (ProductPromote)this.FindControl("ProductPromote"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); this.hidCombinaid = (HtmlInputHidden)this.FindControl("hidCombinaid"); this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.ulConsultations = (HtmlGenericControl)this.FindControl("ulConsultations"); this.divShortDescription = (HtmlGenericControl)this.FindControl("divShortDescription"); this.hidRegionId = (HtmlInputHidden)this.FindControl("hidRegionId"); this.divProductReferral = (HtmlGenericControl)this.FindControl("divProductReferral"); this.hidden_productId = (HtmlInputHidden)this.FindControl("hidden_productId"); this.hidCouponCount = (HtmlInputHidden)this.FindControl("hidCouponCount"); this.hidHasStores = (HtmlInputHidden)this.FindControl("hidHasStores"); this.divPodrequest = (HtmlGenericControl)this.FindControl("divPodrequest"); this.divGuest = (HtmlGenericControl)this.FindControl("divGuest"); this.divcombina = (HtmlGenericControl)this.FindControl("divcombina"); this.hidUnOnSale = (HtmlInputHidden)this.FindControl("hidUnOnSale"); this.hidUnAudit = (HtmlInputHidden)this.FindControl("hidUnAudit"); this.divPhonePrice = (HtmlGenericControl)this.FindControl("divPhonePrice"); this.litPhonePrice = (Literal)this.FindControl("litPhonePrice"); this.spdiscount = (HtmlGenericControl)this.FindControl("spdiscount"); this.ulsupplier = (HtmlGenericControl)this.FindControl("ulsupplier"); this.divGouMai = (HtmlGenericControl)this.FindControl("divGouMai"); this.ltlBottomStatus = (Literal)this.FindControl("ltlBottomStatus"); this.hdAppId.Value = masterSettings.WeixinAppId; this.hidStoreId.Value = this.storeId.ToString(); HtmlInputHidden htmlInputHidden = this.hidRegionId; int num = HiContext.Current.DeliveryScopRegionId; htmlInputHidden.Value = num.ToString(); this.hidden_skuItem = (HtmlInputHidden)this.FindControl("hidden_skuItem"); this.hidCartQuantity = (HtmlInputHidden)this.FindControl("txCartQuantity"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.lit_IsRefund = (Literal)this.FindControl("lit_IsRefund"); this.lit_IsOverRefund = (Literal)this.FindControl("lit_IsOverRefund"); this.lit_RefundTime = (Literal)this.FindControl("lit_RefundTime"); ProductBrowseInfo wAPProductBrowseInfo = ProductBrowser.GetWAPProductBrowseInfo(this.productId, null, masterSettings.OpenMultStore, 0); StoreProductQuery storeProductQuery = new StoreProductQuery { ProductId = this.productId, StoreId = this.storeId }; string cookie = WebHelper.GetCookie("UserCoordinateCookie", "NewCoordinate"); if (!string.IsNullOrEmpty(cookie)) { string[] array = cookie.Split(','); storeProductQuery.Position = new PositionInfo(array[0].ToDouble(0), array[1].ToDouble(0)); storeProductQuery.Position.CityId = WebHelper.GetCookie("UserCoordinateCookie", "CityRegionId").ToInt(0); storeProductQuery.Position.AreaId = WebHelper.GetCookie("UserCoordinateCookie", "RegionId").ToInt(0); } else { storeProductQuery.Position = new PositionInfo(0.0, 0.0); storeProductQuery.Position.CityId = 0; storeProductQuery.Position.AreaId = 0; } this.hidStoreId.Value = this.storeId.ToString(); if (this.storeId > 0) { ProductModel storeProduct = ProductBrowser.GetStoreProduct(storeProductQuery); if (storeProduct == null || storeProduct.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("ProductDelete.aspx"); return; } if (storeProduct.SaleStatus == ProductSaleStatus.OnStock) { base.GotoResourceNotFound("商品已经入库"); } if (wAPProductBrowseInfo.Product.ProductType != 1.GetHashCode()) { HttpContext.Current.Response.Redirect("ProductDetail?productId=" + this.productId); } if (storeProduct.SaleStatus == ProductSaleStatus.UnSale) { this.hidUnOnSale.Value = "1"; } this.litSalePrice.Text = ((storeProduct.MinSalePrice == storeProduct.MaxSalePrice) ? storeProduct.MinSalePrice.F2ToString("f2") : (storeProduct.MinSalePrice.F2ToString("f2") + "~" + storeProduct.MaxSalePrice.F2ToString("f2"))); this.skuStoreSubmitOrder.IsServiceProduct = true; this.skuStoreSubmitOrder.ProductInfo = storeProduct; this.skuSubmitOrder.Visible = false; } else { if (wAPProductBrowseInfo.Product == null || wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("ProductDelete.aspx"); return; } if (wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock) { base.GotoResourceNotFound("商品已经入库"); } if (wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale) { this.hidUnOnSale.Value = "1"; } this.litSalePrice.Text = ((wAPProductBrowseInfo.Product.MinSalePrice == wAPProductBrowseInfo.Product.MaxSalePrice) ? wAPProductBrowseInfo.Product.MinSalePrice.F2ToString("f2") : (wAPProductBrowseInfo.Product.MinSalePrice.F2ToString("f2") + "~" + wAPProductBrowseInfo.Product.MaxSalePrice.F2ToString("f2"))); this.skuSubmitOrder.ProductInfo = wAPProductBrowseInfo.Product; this.skuStoreSubmitOrder.Visible = false; } if (masterSettings.OpenMultStore) { if (StoresHelper.ProductInStoreAndIsAboveSelf(this.productId)) { this.hidHasStores.Value = "1"; this.hidCanTakeOnStore.Value = "1"; } } else if (masterSettings.IsOpenPickeupInStore && wAPProductBrowseInfo.Product.SupplierId == 0) { this.hidCanTakeOnStore.Value = "1"; } if (SalesHelper.IsSupportPodrequest() && wAPProductBrowseInfo.Product.SupplierId == 0) { this.divPodrequest.Visible = true; } HtmlInputHidden htmlInputHidden2 = this.hidUnAudit; num = (int)wAPProductBrowseInfo.Product.AuditStatus; htmlInputHidden2.Value = num.ToString(); if (this.spdiscount != null && HiContext.Current.User.UserId > 0) { MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(HiContext.Current.User.GradeId); this.spdiscount.Visible = true; this.spdiscount.InnerHtml = "<strong class='vip_price'><img src='/templates/pccommon/images/vip_price.png' />" + memberGrade.Name + "价</strong>"; } this.lbUserProductRefer.product = wAPProductBrowseInfo.Product; this.hdTitle.Value = Globals.StripAllTags(string.IsNullOrEmpty(wAPProductBrowseInfo.Product.Title) ? wAPProductBrowseInfo.Product.ProductName : wAPProductBrowseInfo.Product.Title); this.hdDesc.Value = Globals.StripAllTags(string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ShortDescription) ? this.hdTitle.Value : wAPProductBrowseInfo.Product.ShortDescription); string oldValue = "/storage/master/product/images/"; string newValue = "/storage/master/product/thumbs410/410_"; if (!string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl1)) { wAPProductBrowseInfo.Product.ImageUrl1 = wAPProductBrowseInfo.Product.ImageUrl1.ToLower().Replace(oldValue, newValue); } string local = string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl1) ? SettingsManager.GetMasterSettings().DefaultProductImage : wAPProductBrowseInfo.Product.ImageUrl1; this.hdImgUrl.Value = Globals.FullPath(local); this.hdLink.Value = Globals.FullPath(HttpContext.Current.Request.Url.ToString()); if (this.hidCartQuantity != null) { this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(this.productId); } if (this.hidden_productId != null) { this.hidden_productId.Value = this.productId.ToString(); } if (this.promote != null) { this.promote.ProductId = this.productId; } MemberInfo user = HiContext.Current.User; if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || wAPProductBrowseInfo.Product.SubMemberDeduct.HasValue)) { if (!wAPProductBrowseInfo.Product.SubMemberDeduct.HasValue) { goto IL_0ed1; } decimal?subMemberDeduct = wAPProductBrowseInfo.Product.SubMemberDeduct; if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue) { goto IL_0ed1; } } goto IL_0f0b; IL_0ed1: int num2; if (HiContext.Current.SiteSettings.OpenReferral == 1 && HiContext.Current.SiteSettings.ShowDeductInProductPage && user.Referral != null) { num2 = (user.Referral.IsRepeled ? 1 : 0); goto IL_0f0c; } goto IL_0f0b; IL_0f0b: num2 = 1; goto IL_0f0c; IL_0f0c: if (num2 != 0) { this.divProductReferral.Visible = false; } bool flag = true; if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl1) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl2) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl3) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl4) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl5)) { wAPProductBrowseInfo.Product.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(this.productId); List <SlideImage> list = new List <SlideImage>(); int supplierId = wAPProductBrowseInfo.Product.SupplierId; if (supplierId > 0) { SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId); if (supplierById != null) { this.hidSupplier.Value = "true"; this.litSupplierName.Text = supplierById.SupplierName; } } else { this.hidSupplier.Value = "false"; flag = false; this.ulsupplier.Style.Add(HtmlTextWriterStyle.Display, "none"); } list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl1, locationUrl)); list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl2, locationUrl)); list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl3, locationUrl)); list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl4, locationUrl)); list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); } this.litProdcutName.Text = wAPProductBrowseInfo.Product.ProductName; if (wAPProductBrowseInfo.Product.MarketPrice.HasValue) { this.litMarketPrice.SetWhenIsNotNull(wAPProductBrowseInfo.Product.MarketPrice.GetValueOrDefault(decimal.Zero).F2ToString("f2")); } this.litShortDescription.Text = wAPProductBrowseInfo.Product.ShortDescription; this.divShortDescription.Visible = !string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ShortDescription); if (wAPProductBrowseInfo.Product.IsRefund) { this.lit_IsRefund.Text = "<img src=\"/templates/common/images/service_gou.png\" /><span class=\"c-green\">随时退</span>"; this.lit_IsOverRefund.Text = (wAPProductBrowseInfo.Product.IsOverRefund ? "" : "<img src=\"/templates/common/images/service_cha.png\" /><span class=\"c-orange\">过期不退</span>"); } else { this.lit_IsRefund.Text = "<img src=\"/templates/common/images/service_cha.png\" /><span class=\"c-orange\">不可退</span>"; } if (!wAPProductBrowseInfo.Product.IsValid) { if (wAPProductBrowseInfo.Product.ValidStartDate.HasValue && wAPProductBrowseInfo.Product.ValidEndDate.HasValue) { Literal literal = this.lit_RefundTime; DateTime value = wAPProductBrowseInfo.Product.ValidStartDate.Value; string arg = value.ToString("yyyy/MM/dd"); value = wAPProductBrowseInfo.Product.ValidEndDate.Value; literal.Text = string.Format("{0}-{1}", arg, value.ToString("yyyy/MM/dd")); } } else { this.lit_RefundTime.Text = "长期有效"; } if (this.litDescription != null) { string text = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(wAPProductBrowseInfo.Product.MobbileDescription)) { text = regex.Replace(wAPProductBrowseInfo.Product.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(wAPProductBrowseInfo.Product.Description)) { text = regex.Replace(wAPProductBrowseInfo.Product.Description, ""); } text = text.Replace("src", "data-url"); text = text.Replace("vurl", "src"); this.litDescription.Text = text; } Literal control = this.litSoldCount; num = wAPProductBrowseInfo.Product.ShowSaleCounts; control.SetWhenIsNotNull(num.ToString()); if (this.expandAttr != null) { this.expandAttr.ProductId = this.productId; } Literal control2 = this.litConsultationsCount; num = wAPProductBrowseInfo.ConsultationCount; control2.SetWhenIsNotNull(num.ToString()); Literal control3 = this.litReviewsCount; num = wAPProductBrowseInfo.ReviewCount; control3.SetWhenIsNotNull(num.ToString()); MemberInfo user2 = HiContext.Current.User; bool flag2 = false; if (user2 != null) { flag2 = ProductBrowser.CheckHasCollect(user2.UserId, this.productId); } this.litHasCollected.SetWhenIsNotNull(flag2 ? "1" : "0"); this.BindCouponList(); PageTitle.AddSiteNameTitle(wAPProductBrowseInfo.Product.ProductName); this.BindCombinaBuyInfo(); this.BindPromotionInfo(); DataTable dBConsultations = wAPProductBrowseInfo.DBConsultations; for (int i = 0; i < dBConsultations.Rows.Count; i++) { dBConsultations.Rows[i]["UserName"] = DataHelper.GetHiddenUsername(dBConsultations.Rows[i]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = dBConsultations; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = dBConsultations.IsNullOrEmpty(); this.ulConsultations.Visible = !dBConsultations.IsNullOrEmpty(); string phonePriceByProductId = PromoteHelper.GetPhonePriceByProductId(this.productId); if (!string.IsNullOrEmpty(phonePriceByProductId)) { this.divPhonePrice.Visible = true; decimal num3 = phonePriceByProductId.Split(',')[0].ToDecimal(0); this.litPhonePrice.Text = num3.F2ToString("f2"); decimal num4 = wAPProductBrowseInfo.Product.MinSalePrice - num3; this.litSalePrice.Text = ((num4 > decimal.Zero) ? num4 : decimal.Zero).F2ToString("f2"); this.lbUserProductRefer.MobileExclusive = num3; } if (flag || this.liOrderPromotions.Visible || this.liOrderPromotions_free2.Visible || this.liProductSendGifts.Visible || this.rptCouponList.Visible) { this.divActivities.Visible = true; } else { this.divActivities.Visible = false; } StoresInfo storeById = StoresHelper.GetStoreById(this.storeId); if (storeById != null) { this.ProcessException(storeById); } }
protected override void AttachChildControls() { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (!int.TryParse(this.Page.Request.QueryString["PreSaleId"], out this.presaleId)) { this.ShowWapMessage("错误的活动ID", "Default.aspx"); return; } ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.presaleId); if (productPreSaleInfo == null) { this.ShowWapMessage("错误的活动ID", "Default.aspx"); return; } if (productPreSaleInfo.PreSaleEndDate < DateTime.Now) { this.Page.Response.Redirect("ProductDetails.aspx?ProductId = " + productPreSaleInfo.ProductId); return; } this.productId = productPreSaleInfo.ProductId; this.hidSupplier = (HtmlInputHidden)this.FindControl("hidSupplier"); this.litSupplierName = (Literal)this.FindControl("litSupplierName"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.rptCouponList = (WapTemplatedRepeater)this.FindControl("rptCouponList"); this.rp_guest = (WapTemplatedRepeater)this.FindControl("rp_guest"); this.rp_com = (WapTemplatedRepeater)this.FindControl("rp_com"); this.litProdcutName = (Literal)this.FindControl("litProdcutName"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litDescription = (Literal)this.FindControl("litDescription"); this.ltlcombinamaininfo = (Literal)this.FindControl("ltlcombinamaininfo"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.expandAttr = (Common_ExpandAttributes)this.FindControl("ExpandAttributes"); this.litSoldCount = (Literal)this.FindControl("litSoldCount"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litReviewsCount = (Literal)this.FindControl("litReviewsCount"); this.litHasCollected = (HtmlInputHidden)this.FindControl("litHasCollected"); this.hidden_skus = (HtmlInputHidden)this.FindControl("hidden_skus"); this.ltlOrderPromotion = (Literal)this.FindControl("ltlOrderPromotion"); this.ltlOrderPromotion2 = (Literal)this.FindControl("ltlOrderPromotion2"); this.ltlProductSendGifts = (Literal)this.FindControl("ltlProductSendGifts"); this.ltlProductSendGifts2 = (Literal)this.FindControl("ltlProductSendGifts2"); this.liOrderPromotions = (HtmlGenericControl)this.FindControl("liOrderPromotions"); this.liOrderPromotions2 = (HtmlGenericControl)this.FindControl("liOrderPromotions2"); this.liProductSendGifts = (HtmlGenericControl)this.FindControl("liProductSendGifts"); this.liProductSendGifts2 = (HtmlGenericControl)this.FindControl("liProductSendGifts2"); this.liOrderPromotions_free2 = (HtmlGenericControl)this.FindControl("liOrderPromotions_free2"); this.liOrderPromotions_free = (HtmlGenericControl)this.FindControl("liOrderPromotions_free"); this.ltlOrderPromotion_free2 = (Literal)this.FindControl("ltlOrderPromotion_free2"); this.ltlOrderPromotion_free = (Literal)this.FindControl("ltlOrderPromotion_free"); this.lbUserProductRefer = (UserProductReferLabel)this.FindControl("lbUserProductRefer"); this.divshiptoregion = (HtmlGenericControl)this.FindControl("divshiptoregion"); this.divwaplocateaddress = (HtmlGenericControl)this.FindControl("divwaplocateaddress"); this.productFreight = (ProductFreightLiteral)this.FindControl("productFreight"); this.promote = (ProductPromote)this.FindControl("ProductPromote"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); this.hidCombinaid = (HtmlInputHidden)this.FindControl("hidCombinaid"); this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.ulConsultations = (HtmlGenericControl)this.FindControl("ulConsultations"); this.divShortDescription = (HtmlGenericControl)this.FindControl("divShortDescription"); this.hidRegionId = (HtmlInputHidden)this.FindControl("hidRegionId"); this.divProductReferral = (HtmlGenericControl)this.FindControl("divProductReferral"); this.hidden_productId = (HtmlInputHidden)this.FindControl("hidden_productId"); this.hidCouponCount = (HtmlInputHidden)this.FindControl("hidCouponCount"); this.hidHasStores = (HtmlInputHidden)this.FindControl("hidHasStores"); this.divPodrequest = (HtmlGenericControl)this.FindControl("divPodrequest"); this.divGuest = (HtmlGenericControl)this.FindControl("divGuest"); this.divcombina = (HtmlGenericControl)this.FindControl("divcombina"); this.hidUnOnSale = (HtmlInputHidden)this.FindControl("hidUnOnSale"); this.divPhonePrice = (HtmlGenericControl)this.FindControl("divPhonePrice"); this.litPhonePrice = (Literal)this.FindControl("litPhonePrice"); this.litpresaleprice = (Literal)this.FindControl("litpresaleprice"); this.litsaleprice = (Literal)this.FindControl("litsaleprice"); this.litRetainage = (Literal)this.FindControl("litRetainage"); this.litDeliverGood = (Literal)this.FindControl("litDeliverGood"); this.hidEndDate = (HtmlInputHidden)this.FindControl("hidEndDate"); this.hidNowDate = (HtmlInputHidden)this.FindControl("hidNowDate"); this.hdAppId.Value = masterSettings.WeixinAppId; HtmlInputHidden htmlInputHidden = this.hidRegionId; int num = HiContext.Current.DeliveryScopRegionId; htmlInputHidden.Value = num.ToString(); this.hidden_skuItem = (HtmlInputHidden)this.FindControl("hidden_skuItem"); this.hidCartQuantity = (HtmlInputHidden)this.FindControl("txCartQuantity"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); ProductBrowseInfo productPreSaleBrowseInfo = ProductBrowser.GetProductPreSaleBrowseInfo(this.productId, true); if (productPreSaleBrowseInfo.Product == null || productPreSaleBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("ProductDelete.aspx"); return; } if (productPreSaleBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale) { this.hidUnOnSale.Value = "1"; } this.litpresaleprice.Text = ((productPreSaleInfo.DepositPercent == 0) ? productPreSaleInfo.Deposit.F2ToString("f2") : ((decimal)productPreSaleInfo.DepositPercent * productPreSaleBrowseInfo.Product.MinSalePrice / 100m).F2ToString("f2")); if (productPreSaleBrowseInfo.Product.MinSalePrice < productPreSaleBrowseInfo.Product.MaxSalePrice) { this.litsaleprice.Text = "¥" + productPreSaleBrowseInfo.Product.MinSalePrice.F2ToString("f2") + "~ ¥" + productPreSaleBrowseInfo.Product.MaxSalePrice.F2ToString("f2"); } else { this.litsaleprice.Text = "¥" + productPreSaleBrowseInfo.Product.MinSalePrice.F2ToString("f2"); } Literal literal = this.litRetainage; DateTime dateTime = productPreSaleInfo.PaymentStartDate; string str = dateTime.ToString("yyyy/MM/dd"); dateTime = productPreSaleInfo.PaymentEndDate; literal.Text = str + "~" + dateTime.ToString("yyyy/MM/dd"); Literal literal2 = this.litDeliverGood; object text; if (!productPreSaleInfo.DeliveryDate.HasValue) { text = $"尾款支付后{productPreSaleInfo.DeliveryDays}天内发货"; } else { dateTime = productPreSaleInfo.DeliveryDate.Value; text = dateTime.ToString("yyyy年MM月dd日") + "发货"; } literal2.Text = (string)text; HtmlInputHidden htmlInputHidden2 = this.hidNowDate; dateTime = DateTime.Now; htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden3 = this.hidEndDate; dateTime = productPreSaleInfo.PreSaleEndDate; htmlInputHidden3.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); this.skuSubmitOrder.ProductInfo = productPreSaleBrowseInfo.Product; this.skuSubmitOrder.OrderBusiness = 4; this.skuSubmitOrder.PreSaleId = this.presaleId; this.skuSubmitOrder.productPreSaleInfo = productPreSaleInfo; this.lbUserProductRefer.product = productPreSaleBrowseInfo.Product; this.productFreight.ShippingTemplateId = productPreSaleBrowseInfo.Product.ShippingTemplateId; this.productFreight.Volume = productPreSaleBrowseInfo.Product.Weight; this.productFreight.Weight = productPreSaleBrowseInfo.Product.Weight; this.hdTitle.Value = Globals.StripAllTags(string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.Title) ? productPreSaleBrowseInfo.Product.ProductName : productPreSaleBrowseInfo.Product.Title); this.hdDesc.Value = Globals.StripAllTags(string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ShortDescription) ? this.hdTitle.Value : productPreSaleBrowseInfo.Product.ShortDescription); string local = string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl1) ? SettingsManager.GetMasterSettings().DefaultProductImage : productPreSaleBrowseInfo.Product.ImageUrl1; this.hdImgUrl.Value = Globals.FullPath(local); this.hdLink.Value = Globals.FullPath(HttpContext.Current.Request.Url.ToString()); IEnumerable enumerable = from item in productPreSaleBrowseInfo.Product.Skus select item.Value; if (this.hidCartQuantity != null) { this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(this.productId); } IEnumerable value = from item in productPreSaleBrowseInfo.Product.Skus select item.Value; if (JsonConvert.SerializeObject(productPreSaleBrowseInfo.DbSKUs) != null) { this.hidden_skuItem.Value = JsonConvert.SerializeObject(productPreSaleBrowseInfo.DbSKUs); } if (this.hidden_skus != null) { this.hidden_skus.Value = JsonConvert.SerializeObject(value); } if (this.hidden_productId != null) { this.hidden_productId.Value = this.productId.ToString(); } if (this.promote != null) { this.promote.ProductId = this.productId; } int supplierId = productPreSaleBrowseInfo.Product.SupplierId; if (supplierId > 0) { SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId); if (supplierById != null) { this.hidSupplier.Value = "true"; this.litSupplierName.Text = supplierById.SupplierName; } } else { this.hidSupplier.Value = "false"; } MemberInfo user = HiContext.Current.User; if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productPreSaleBrowseInfo.Product.SubMemberDeduct.HasValue)) { if (!productPreSaleBrowseInfo.Product.SubMemberDeduct.HasValue) { goto IL_0c63; } decimal?subMemberDeduct = productPreSaleBrowseInfo.Product.SubMemberDeduct; if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue) { goto IL_0c63; } } goto IL_0c89; IL_0c89: int num2 = 1; goto IL_0c8a; IL_0c8a: if (num2 != 0) { this.divProductReferral.Visible = false; } if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl1) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl2) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl3) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl4) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl5)) { productPreSaleBrowseInfo.Product.ImageUrl1 = masterSettings.DefaultProductImage; } List <SlideImage> list = new List <SlideImage>(); list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl1, locationUrl)); list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl2, locationUrl)); list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl3, locationUrl)); list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl4, locationUrl)); list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); } this.litProdcutName.Text = productPreSaleBrowseInfo.Product.ProductName; this.litShortDescription.Text = productPreSaleBrowseInfo.Product.ShortDescription; this.divShortDescription.Visible = !string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ShortDescription); if (this.litDescription != null) { string text2 = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productPreSaleBrowseInfo.Product.MobbileDescription)) { text2 = regex.Replace(productPreSaleBrowseInfo.Product.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productPreSaleBrowseInfo.Product.Description)) { text2 = regex.Replace(productPreSaleBrowseInfo.Product.Description, ""); } text2 = text2.Replace("src", "data-url"); this.litDescription.Text = text2; } Literal control = this.litSoldCount; num = productPreSaleBrowseInfo.Product.ShowSaleCounts; control.SetWhenIsNotNull(num.ToString()); if (this.expandAttr != null) { this.expandAttr.ProductId = this.productId; } Literal control2 = this.litConsultationsCount; num = productPreSaleBrowseInfo.ConsultationCount; control2.SetWhenIsNotNull(num.ToString()); Literal control3 = this.litReviewsCount; num = productPreSaleBrowseInfo.ReviewCount; control3.SetWhenIsNotNull(num.ToString()); MemberInfo user2 = HiContext.Current.User; bool flag = false; if (user2 != null) { flag = ProductBrowser.CheckHasCollect(user2.UserId, this.productId); } this.litHasCollected.SetWhenIsNotNull(flag ? "1" : "0"); this.BindCouponList(); PageTitle.AddSiteNameTitle(productPreSaleBrowseInfo.Product.ProductName); this.BindPromotionInfo(); this.BindGuestProducts(); DataTable dBConsultations = productPreSaleBrowseInfo.DBConsultations; for (int i = 0; i < dBConsultations.Rows.Count; i++) { dBConsultations.Rows[i]["UserName"] = DataHelper.GetHiddenUsername(dBConsultations.Rows[i]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = dBConsultations; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = dBConsultations.IsNullOrEmpty(); this.ulConsultations.Visible = !dBConsultations.IsNullOrEmpty(); return; IL_0c63: if (HiContext.Current.SiteSettings.OpenReferral == 1) { num2 = ((!HiContext.Current.SiteSettings.ShowDeductInProductPage) ? 1 : 0); goto IL_0c8a; } goto IL_0c89; }
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(); } } } }
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(); } } }
protected override void AttachChildControls() { if (!int.TryParse(base.GetParameter("countDownId", false), out this.countDownId)) { 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.litSurplusNumber = (Literal)this.FindControl("litSurplusNumber"); this.litWeight = (Label)this.FindControl("litWeight"); this.litBrosedNum = (Literal)this.FindControl("litBrosedNum"); this.litBrand = (Literal)this.FindControl("litBrand"); this.litmaxcount = (Literal)this.FindControl("litMaxCount"); 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.ltlSaleCount = (Literal)this.FindControl("ltlSaleCount"); this.ltlConsultation = (Literal)this.FindControl("ltlConsultation"); this.ltlReviewCount = (Literal)this.FindControl("ltlReviewCount"); this.lblCurrentSalePrice = (FormatedMoneyLabel)this.FindControl("lblCurrentSalePrice"); this.litContent = (Literal)this.FindControl("litContent"); this.lblEndTime = (FormatedTimeLabel)this.FindControl("lblEndTime"); this.lblStartTime = (FormatedTimeLabel)this.FindControl("lblStartTime"); 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.consultations = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations"); this.correlative = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative"); this.nowTime = (HtmlInputHidden)this.FindControl("nowTime"); this.nowTime.SetWhenIsNotNull(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo)); this.hidden_skus = (HtmlInputHidden)this.FindControl("hidden_skus"); this.hidden_skuItem = (HtmlInputHidden)this.FindControl("hidden_skuItem"); this.hidden_IsOver = (HtmlInputHidden)this.FindControl("hidden_IsOver"); this.hidden_CountDownId = (HtmlInputHidden)this.FindControl("hidden_CountDownId"); this.hidden_productId = (HtmlInputHidden)this.FindControl("hidden_productId"); this.hdShareDetails = (HtmlInputHidden)this.FindControl("hdShareDetails"); this.hdShareIcon = (HtmlInputHidden)this.FindControl("hdShareIcon"); this.hdShareTitle = (HtmlInputHidden)this.FindControl("hdShareTitle"); if (!this.Page.IsPostBack) { CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.countDownId, 0); SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (countDownInfo != null) { HtmlInputHidden htmlInputHidden = this.hidden_CountDownId; int num = countDownInfo.CountDownId; htmlInputHidden.Value = num.ToString(); HtmlInputHidden htmlInputHidden2 = this.hidden_productId; num = countDownInfo.ProductId; htmlInputHidden2.Value = num.ToString(); int num2 = 0; ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(countDownInfo.ProductId, null, masterSettings.OpenMultStore, 0); Literal literal = this.ltlReviewCount; num = productBrowseInfo.ReviewCount; literal.Text = num.ToString(); Literal literal2 = this.ltlSaleCount; num = productBrowseInfo.SaleCount; literal2.Text = num.ToString(); if (productBrowseInfo.Product == null) { this.hidden_IsOver.Value = "pullOff"; } else if (!productBrowseInfo.Product.SaleStatus.Equals(ProductSaleStatus.OnSale)) { this.hidden_IsOver.Value = "pullOff"; } if (!string.IsNullOrEmpty(countDownInfo.ShareDetails)) { HtmlInputHidden htmlInputHidden3 = this.hdShareDetails; htmlInputHidden3.Value += countDownInfo.ShareDetails; } else if (!string.IsNullOrEmpty(countDownInfo.Content)) { this.hdShareDetails.Value = "限时抢购简单说明:"; HtmlInputHidden htmlInputHidden4 = this.hdShareDetails; htmlInputHidden4.Value += countDownInfo.Content; } else { this.hdShareDetails.Value = "限时抢购简单说明:"; } Literal literal3 = this.ltlConsultation; num = productBrowseInfo.ConsultationCount; literal3.Text = num.ToString(); this.hdShareIcon.Value = Globals.FullPath(countDownInfo.ShareIcon); this.hdShareTitle.Value = countDownInfo.ShareTitle; if (countDownInfo.StartDate > DateTime.Now) { this.hidden_IsOver.Value = "AboutToBegin"; } else if (countDownInfo.EndDate < DateTime.Now) { this.hidden_IsOver.Value = "over"; } else if (!countDownInfo.IsRunning) { this.hidden_IsOver.Value = "true"; } num2 = PromoteHelper.GetCountDownSurplusNumber(this.countDownId); num2 = ((num2 >= 0) ? num2 : 0); this.litSurplusNumber.Text = num2.ToString(); Dictionary <string, SKUItem> dictionary = new Dictionary <string, SKUItem>(); foreach (SKUItem value2 in productBrowseInfo.Product.Skus.Values) { CountDownSkuInfo countDownSkuInfo = (from c in countDownInfo.CountDownSkuInfo where c.SkuId == value2.SkuId select c).FirstOrDefault(); if (countDownSkuInfo != null) { value2.Stock = ((value2.Stock < countDownSkuInfo.ActivityTotal - countDownSkuInfo.BoughtCount) ? value2.Stock : (countDownSkuInfo.ActivityTotal - countDownSkuInfo.BoughtCount)); } dictionary.Add(value2.SkuId, value2); } IEnumerable value = from item in dictionary 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.hpkProductConsultations.Target = "_blank"; this.hpkProductConsultations.Text = "查看全部"; this.hpkProductConsultations.NavigateUrl = $"ProductConsultationsAndReplay.aspx?productId={countDownInfo.ProductId}"; this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName); this.LoadCountDownBuyInfo(countDownInfo); this.btnOrder.Stock = productBrowseInfo.Product.Stock; if (!countDownInfo.IsJoin) { this.hidden_IsOver.Value = "nojoin"; } BrowsedProductQueue.EnQueue(countDownInfo.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 = countDownInfo.ProductId; this.skuSelector.DataSource = productBrowseInfo.DbSKUs; } if (productBrowseInfo.DBConsultations != null) { this.consultations.DataSource = productBrowseInfo.DBConsultations; this.consultations.DataBind(); } if (productBrowseInfo.DbCorrelatives != null) { this.correlative.DataSource = productBrowseInfo.DbCorrelatives; this.correlative.DataBind(); } } else { base.GotoResourceNotFound(); } } }
protected override void AttachChildControls() { if (!int.TryParse(base.GetParameter("PreSaleId", false), out this.preSaleId)) { base.GotoResourceNotFound(); } ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.preSaleId); if (productPreSaleInfo == null) { base.GotoResourceNotFound(); } this.productId = productPreSaleInfo.ProductId; if (productPreSaleInfo.PreSaleEndDate < DateTime.Now) { this.Page.Response.Redirect("/ProductDetails.aspx?productId=" + this.productId); return; } this.hidSupName = (HtmlInputHidden)this.FindControl("hidSupName"); this.litSupplierName = (Literal)this.FindControl("litSupplierName"); this.hiddenpid = (HtmlInputHidden)this.FindControl("hiddenpid"); this.hidCartQuantity = (HtmlInputHidden)this.FindControl("txCartQuantity"); this.hiddenpid.Value = this.productId.ToString(); this.common_Location = (Common_Location)this.FindControl("common_Location"); this.litProductName = (Literal)this.FindControl("litProductName"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.litSaleCounts = (Literal)this.FindControl("litSaleCounts"); this.lblBuyPrice = (Label)this.FindControl("lblBuyPrice"); this.lblTotalPrice = (TotalLabel)this.FindControl("lblTotalPrice"); this.lblSku = (SkuLabel)this.FindControl("lblSku"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.btnBuy = (BuyButton)this.FindControl("btnBuy"); this.hpkProductConsultations = (HyperLink)this.FindControl("hpkProductConsultations"); this.ltlSaleCount = (Literal)this.FindControl("ltlSaleCount"); this.ltlReviewCount = (Literal)this.FindControl("ltlReviewCount"); this.litReviewCount = (Literal)this.FindControl("litReviewCount"); this.ltlConsultation = (Literal)this.FindControl("ltlConsultation"); this.images = (Common_ProductImages)this.FindControl("common_ProductImages"); this.rptExpandAttributes = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes"); this.rptOnlineService = (ThemedTemplatedRepeater)this.FindControl("rptOnlineService"); this.skuSelector = (SKUSelector)this.FindControl("SKUSelector"); 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 = (HtmlInputHidden)this.FindControl("hidden_skus"); this.hidden_skuItem = (HtmlInputHidden)this.FindControl("hidden_skuItem"); this.hidIsOpenMultiStore = (HtmlInputHidden)this.FindControl("hidIsOpenMultiStore"); this.aCountDownUrl = (HyperLink)this.FindControl("aCountDownUrl"); this.imgQrCode = (Image)this.FindControl("imgQrCode"); this.hidden_productId = (HtmlInputHidden)this.FindControl("hidden_productId"); this.hidHasStores = (HtmlInputHidden)this.FindControl("hidHasStores"); this.divGift = (HtmlGenericControl)this.FindControl("divGift"); this.ltlGiftName = (Literal)this.FindControl("ltlGiftName"); this.ltlGiftNum = (Literal)this.FindControl("ltlGiftNum"); this.aBrand = (HtmlAnchor)this.FindControl("aBrand"); this.imgBrand = (HiImage)this.FindControl("imgBrand"); this.imgCustomerService = (HtmlImage)this.FindControl("imgCustomerService"); this.ltlOrderPromotion = (Literal)this.FindControl("ltlOrderPromotion"); this.divOrderPromotions = (HtmlGenericControl)this.FindControl("divOrderPromotions"); this.divOrderPromotions2 = (HtmlGenericControl)this.FindControl("divOrderPromotions2"); this.divOrderPromotions4 = (HtmlGenericControl)this.FindControl("divOrderPromotions4"); this.divOrderPromotions3 = (HtmlGenericControl)this.FindControl("divOrderPromotions3"); this.ltlOrderPromotion_free = (Literal)this.FindControl("ltlOrderPromotion_free"); this.litPhonePrice = (Literal)this.FindControl("litPhonePrice"); this.litPhonePriceEndDate = (Literal)this.FindControl("litPhonePriceEndDate"); this.divCuxiao = (HtmlGenericControl)this.FindControl("divCuxiao"); this.ltlUnit = (Literal)this.FindControl("ltlUnit"); this.divProductReferral = (HtmlGenericControl)this.FindControl("divProductReferral"); this.ltlProductSendGifts = (Literal)this.FindControl("ltlProductSendGifts"); this.ltlPromotionSendGifts = (Literal)this.FindControl("ltlPromotionSendGifts"); this.setDeliverRegion = (Common_SetDeliveryRegion)this.FindControl("setDeliverRegion"); this.divqq = (HtmlGenericControl)this.FindControl("divqq"); this.lblPaymentStartDate = (Label)this.FindControl("lblPaymentStartDate"); this.lblPaymentEndDate = (Label)this.FindControl("lblPaymentEndDate"); this.lblDelivery = (Label)this.FindControl("lblDelivery"); this.lblDepositPercent = (Label)this.FindControl("lblDepositPercent"); this.lblDeposit = (Label)this.FindControl("lblDeposit"); this.lblFinalPaymentPercent = (Label)this.FindControl("lblFinalPaymentPercent"); this.lblFinalPayment = (Label)this.FindControl("lblFinalPayment"); this.hidEndDate = (HtmlInputHidden)this.FindControl("hidEndDate"); this.hidNowDate = (HtmlInputHidden)this.FindControl("hidNowDate"); this.hidDepositPercent = (HtmlInputHidden)this.FindControl("hidDepositPercent"); this.hidDeposit = (HtmlInputHidden)this.FindControl("hidDeposit"); ThemedTemplatedRepeater themedTemplatedRepeater = (ThemedTemplatedRepeater)this.FindControl("rptOtherProducts"); this.aCountDownUrl.Visible = false; if (this.Page.IsPostBack) { return; } if (this.imgQrCode != null) { string text = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png"; Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text, false, ImageFormats.Png); this.imgQrCode.ImageUrl = text; } ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, this.sitesettings.OpenMultStore, -1); if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("/ProductDelete.aspx"); return; } this.setDeliverRegion.ShippingTemplateId = productBrowseInfo.Product.ShippingTemplateId; this.setDeliverRegion.Volume = productBrowseInfo.Product.Weight; this.setDeliverRegion.Weight = productBrowseInfo.Product.Weight; this.ActivityBusiness(); if (this.hidCartQuantity != null) { this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(productBrowseInfo.Product.ProductId); } 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(base.GetRouteUrl("unproductdetails", new { ProductId = this.productId })); } if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock) { this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库")); return; } this.hidden_productId.Value = this.productId.ToString(); this.LoadPageSearch(productBrowseInfo.Product); if (this.lbUserProductRefer != null && this.sitesettings.OpenReferral == 1 && this.sitesettings.ShowDeductInProductPage) { this.lbUserProductRefer.product = productBrowseInfo.Product; } HyperLink hyperLink = this.hpkProductConsultations; int num = productBrowseInfo.ConsultationCount; hyperLink.Text = "查看全部" + num.ToString() + "条咨询"; Literal literal = this.ltlConsultation; num = productBrowseInfo.ConsultationCount; literal.Text = num.ToString(); Literal literal2 = this.ltlSaleCount; num = productBrowseInfo.SaleCount; literal2.Text = num.ToString(); Literal literal3 = this.ltlReviewCount; num = productBrowseInfo.ReviewCount; literal3.Text = num.ToString(); Literal literal4 = this.litReviewCount; num = productBrowseInfo.ReviewCount; literal4.Text = num.ToString(); this.hpkProductConsultations.NavigateUrl = $"ProductConsultationsAndReplay.aspx?productId={this.productId}"; this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName); HtmlInputHidden htmlInputHidden = this.hidNowDate; DateTime dateTime = DateTime.Now; htmlInputHidden.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden2 = this.hidEndDate; dateTime = productPreSaleInfo.PreSaleEndDate; htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); Label label = this.lblPaymentStartDate; dateTime = productPreSaleInfo.PaymentStartDate; label.Text = dateTime.ToString("yyyy.MM.dd"); Label label2 = this.lblPaymentEndDate; dateTime = productPreSaleInfo.PaymentEndDate; label2.Text = dateTime.ToString("yyyy.MM.dd"); Label label3 = this.lblDelivery; object text2; if (productPreSaleInfo.DeliveryDays <= 0) { dateTime = productPreSaleInfo.DeliveryDate.Value; text2 = dateTime.ToString("yyyy.MM.dd") + "前发货"; } else { text2 = "尾款支付后" + productPreSaleInfo.DeliveryDays + "天发货"; } label3.Text = (string)text2; decimal d; if (productPreSaleInfo.DepositPercent > 0) { this.lblDepositPercent.Text = "定金:" + productPreSaleInfo.DepositPercent + "%"; this.lblFinalPaymentPercent.Text = "尾款:" + (100 - productPreSaleInfo.DepositPercent) + "%"; decimal num2 = Math.Round(productBrowseInfo.Product.MinSalePrice * (decimal)productPreSaleInfo.DepositPercent / 100m, 2); this.lblDeposit.Text = "¥" + num2; this.lblFinalPayment.Text = "¥" + Math.Round(productBrowseInfo.Product.MinSalePrice - num2, 2); HtmlInputHidden htmlInputHidden3 = this.hidDepositPercent; num = productPreSaleInfo.DepositPercent; htmlInputHidden3.Value = num.ToString(); } else { this.lblDeposit.Text = "定金:¥" + productPreSaleInfo.Deposit; this.lblFinalPayment.Text = "尾款:¥" + Math.Round(productBrowseInfo.Product.MinSalePrice - productPreSaleInfo.Deposit, 2); HtmlInputHidden htmlInputHidden4 = this.hidDeposit; d = productPreSaleInfo.Deposit; htmlInputHidden4.Value = d.ToString(); } this.btnBuy.Stock = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock); this.ltlUnit.Text = productBrowseInfo.Product.Unit; this.divqq.Visible = (this.sitesettings.ServiceIsOpen == "1"); MemberInfo user = HiContext.Current.User; if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productBrowseInfo.Product.SubMemberDeduct.HasValue)) { if (!productBrowseInfo.Product.SubMemberDeduct.HasValue) { goto IL_0d79; } decimal?subMemberDeduct = productBrowseInfo.Product.SubMemberDeduct; d = default(decimal); if (!(subMemberDeduct.GetValueOrDefault() <= d) || !subMemberDeduct.HasValue) { goto IL_0d79; } } goto IL_0d9f; IL_0da0: int num3; if (num3 != 0) { this.divProductReferral.Visible = false; } 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 (productBrowseInfo.Product.BrandId.HasValue) { BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value); if (brandCategory != null && !string.IsNullOrEmpty(brandCategory.Logo)) { this.imgBrand.ImageUrl = brandCategory.Logo; this.aBrand.HRef = base.GetRouteUrl("branddetails", new { brandId = brandCategory.BrandId }); } } int supplierId = productBrowseInfo.Product.SupplierId; if (supplierId > 0) { SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId); if (!string.IsNullOrEmpty(supplierById.Picture)) { this.imgBrand.ImageUrl = supplierById.Picture; } else if (productBrowseInfo.Product.BrandId.HasValue) { BrandCategoryInfo brandCategory2 = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value); if (brandCategory2 != null && !string.IsNullOrEmpty(brandCategory2.Logo)) { this.imgBrand.ImageUrl = brandCategory2.Logo; this.aBrand.HRef = base.GetRouteUrl("branddetails", new { brandId = brandCategory2.BrandId }); } } else { this.imgBrand.Visible = false; } this.litSupplierName.Text = supplierById.SupplierName; this.hidSupName.Value = supplierById.SupplierName; } else { this.litSupplierName.Visible = false; if (productBrowseInfo.Product.BrandId.HasValue) { BrandCategoryInfo brandCategory3 = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value); if (brandCategory3 != null && !string.IsNullOrEmpty(brandCategory3.Logo)) { this.imgBrand.ImageUrl = brandCategory3.Logo; this.aBrand.HRef = base.GetRouteUrl("branddetails", new { brandId = brandCategory3.BrandId }); } } } if (productBrowseInfo.DBConsultations != null) { this.consultations.DataSource = productBrowseInfo.DBConsultations; this.consultations.DataBind(); } if (productBrowseInfo.DbCorrelatives != null) { this.correlative.DataSource = productBrowseInfo.DbCorrelatives; this.correlative.DataBind(); } this.BindOrderPromotions(); if (!this.divOrderPromotions.Visible && !this.divOrderPromotions2.Visible && !this.divOrderPromotions3.Visible) { this.divCuxiao.Style.Add("display", "none"); } if (this.rptOnlineService != null) { IList <OnlineServiceInfo> allOnlineService = OnlineServiceHelper.GetAllOnlineService(0, 1); IList <OnlineServiceInfo> allOnlineService2 = OnlineServiceHelper.GetAllOnlineService(0, 2); if (allOnlineService2 != null) { foreach (OnlineServiceInfo item in allOnlineService2) { allOnlineService.Add(item); } } this.rptOnlineService.DataSource = allOnlineService; this.rptOnlineService.DataBind(); } return; IL_0d9f: num3 = 1; goto IL_0da0; IL_0d79: if (HiContext.Current.SiteSettings.OpenReferral == 1) { num3 = ((!HiContext.Current.SiteSettings.ShowDeductInProductPage) ? 1 : 0); goto IL_0da0; } goto IL_0d9f; }
protected override void AttachChildControls() { base.CheckOpenMultStore(); if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { this.ShowWapMessage("错误的商品ID", "Default.aspx"); } this.aCountDownUrl = (HyperLink)this.FindControl("aCountDownUrl"); this.divCountDownUrl = (HtmlGenericControl)this.FindControl("divCountDownUrl"); this.aCountDownUrl.Visible = false; this.HasActivitiesToJumpUrl(); MemberInfo user = HiContext.Current.User; if (user.UserId != 0 && user.IsReferral() && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"])) { string text = HttpContext.Current.Request.Url.ToString(); text = ((text.IndexOf("?") <= -1) ? (text + "?ReferralUserId=" + HiContext.Current.UserId) : (text + "&ReferralUserId=" + HiContext.Current.UserId)); this.Page.Response.Redirect(text); return; } SiteSettings masterSettings = SettingsManager.GetMasterSettings(); this.litPdImgSlides = (Literal)this.FindControl("litPdImgSlides"); this.rptCouponList = (WapTemplatedRepeater)this.FindControl("rptCouponList"); this.rp_guest = (WapTemplatedRepeater)this.FindControl("rp_guest"); this.rp_com = (WapTemplatedRepeater)this.FindControl("rp_com"); this.litProdcutName = (Literal)this.FindControl("litProdcutName"); this.litSalePrice = (Literal)this.FindControl("litSalePrice"); this.litMarketPrice = (Literal)this.FindControl("litMarketPrice"); this.litReferral = (Literal)this.FindControl("litReferral"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litDescription = (Literal)this.FindControl("litDescription"); this.ltlBottomStatus = (Literal)this.FindControl("ltlBottomStatus"); this.skuSubmitOrder = (Common_SKUSubmitStoreOrder)this.FindControl("skuSubmitOrder"); this.litSoldCount = (Literal)this.FindControl("litSoldCount"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litReviewsCount = (Literal)this.FindControl("litReviewsCount"); this.litStoreId = (HtmlInputHidden)this.FindControl("litStoreId"); this.litStoreId.Value = this.storeId.ToString(); this.litHasCollected = (HtmlInputHidden)this.FindControl("litHasCollected"); this.hidLngLat = (HtmlInputHidden)this.FindControl("hidLngLat"); this.hdQQMapKey = (HtmlInputHidden)this.FindControl("hdQQMapKey"); this.hidStoreName = (HtmlInputHidden)this.FindControl("hidStoreName"); this.divShortDescription = (HtmlGenericControl)this.FindControl("divShortDescription"); this.divProductReferral = (HtmlGenericControl)this.FindControl("divProductReferral"); this.hidUnOnSale = (HtmlInputHidden)this.FindControl("hidUnOnSale"); this.hidRecommend = (HtmlInputHidden)this.FindControl("hidRecommend"); this.hidNoData = (HtmlInputHidden)this.FindControl("hidNoData"); this.divGouMai = (HtmlGenericControl)this.FindControl("divGouMai"); this.hidStoreId = (HtmlInputHidden)this.FindControl("hidStoreId"); this.ltlMessage = (Literal)this.FindControl("ltlMessage"); this.spdiscount = (HtmlGenericControl)this.FindControl("spdiscount"); this.hidRecommend.Value = (masterSettings.Store_IsRecommend ? "1" : "0"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); this.hdAppId.Value = masterSettings.WeixinAppId; StoreProductQuery storeProductQuery = new StoreProductQuery { ProductId = this.productId, StoreId = this.storeId }; string cookie = WebHelper.GetCookie("UserCoordinateCookie", "NewCoordinate"); if (!string.IsNullOrEmpty(cookie)) { string[] array = cookie.Split(','); storeProductQuery.Position = new PositionInfo(array[0].ToDouble(0), array[1].ToDouble(0)); storeProductQuery.Position.CityId = WebHelper.GetCookie("UserCoordinateCookie", "CityRegionId").ToInt(0); storeProductQuery.Position.AreaId = WebHelper.GetCookie("UserCoordinateCookie", "RegionId").ToInt(0); } else { storeProductQuery.Position = new PositionInfo(0.0, 0.0); storeProductQuery.Position.CityId = 0; storeProductQuery.Position.AreaId = 0; } this.hidStoreId.Value = this.storeId.ToString(); ProductModel storeProduct = ProductBrowser.GetStoreProduct(storeProductQuery); this.skuSubmitOrder.ProductInfo = storeProduct; if (storeProduct == null || storeProduct.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("ProductDelete.aspx"); return; } if (storeProduct.ProductType == 1.GetHashCode()) { HttpContext.Current.Response.Redirect("ServiceProductDetails?productId=" + this.productId + "&StoreID=" + this.storeId); } if (storeProduct.SaleStatus != ProductSaleStatus.OnSale) { this.hidUnOnSale.Value = "1"; } if (this.spdiscount != null && HiContext.Current.User.UserId > 0) { MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(HiContext.Current.User.GradeId); this.spdiscount.Visible = true; this.spdiscount.InnerHtml = "<strong class='vip_price'><img src='/templates/pccommon/images/vip_price.png' />" + memberGrade.Name + "价</strong>"; } MemberInfo user2 = HiContext.Current.User; if (user2 != null && user2.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || storeProduct.SubMemberDeduct.HasValue)) { if (!storeProduct.SubMemberDeduct.HasValue) { goto IL_078d; } decimal?subMemberDeduct = storeProduct.SubMemberDeduct; if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue) { goto IL_078d; } } goto IL_07c7; IL_078d: int num; if (HiContext.Current.SiteSettings.OpenReferral == 1 && HiContext.Current.SiteSettings.ShowDeductInProductPage && user2.Referral != null) { num = (user2.Referral.IsRepeled ? 1 : 0); goto IL_07c8; } goto IL_07c7; IL_07c8: if (num != 0) { this.divProductReferral.Visible = false; } else { this.litReferral.Text = storeProduct.ProductReduce; } storeProduct.ImgUrlList.ForEach(delegate(string i) { Literal literal5 = this.litPdImgSlides; literal5.Text += $"<img src=\"{i}\" />"; }); this.litProdcutName.Text = storeProduct.ProductName; this.litSalePrice.Text = ((storeProduct.MinSalePrice == storeProduct.MaxSalePrice) ? storeProduct.MinSalePrice.F2ToString("f2") : (storeProduct.MinSalePrice.F2ToString("f2") + "~" + storeProduct.MaxSalePrice.F2ToString("f2"))); this.litMarketPrice.Text = storeProduct.MarketPrice.F2ToString("f2"); this.litShortDescription.Text = storeProduct.ShortDescription; this.divShortDescription.Visible = !string.IsNullOrEmpty(storeProduct.ShortDescription); if (!string.IsNullOrWhiteSpace(storeProduct.Description)) { Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); this.litDescription.Text = regex.Replace(storeProduct.Description, "").Replace("src", "data-url"); } Literal literal = this.litSoldCount; int num2 = storeProduct.ShowSaleCounts; literal.Text = num2.ToString(); Literal control = this.litConsultationsCount; num2 = storeProduct.ConsultationCount; control.SetWhenIsNotNull(num2.ToString()); Literal control2 = this.litReviewsCount; num2 = storeProduct.ReviewCount; control2.SetWhenIsNotNull(num2.ToString()); if (storeProduct.StoreInfo.IsInServiceArea) { this.ltlStoreName = (Literal)this.FindControl("ltlStoreName"); this.ltlStoreName.Text = storeProduct.StoreInfo.StoreName; this.ltlDistance = (Literal)this.FindControl("ltlDistance"); this.ltlDistance.Text = storeProduct.StoreInfo.Distance; this.ltlDelivery = (Literal)this.FindControl("ltlDelivery"); this.ltlDelivery.Text = storeProduct.StoreInfo.Delivery.DeliveryList.Aggregate(string.Empty, (string t, string n) => "<li>" + t + "</li><li>" + n + "</li>"); this.ltlDeliveryDetail = (Literal)this.FindControl("ltlDeliveryDetail"); if (storeProduct.StoreInfo.Delivery.IsStoreDelive) { if (storeProduct.StoreInfo.Delivery.MinOrderPrice > decimal.Zero) { Literal literal2 = this.ltlDeliveryDetail; num2 = storeProduct.StoreInfo.Delivery.MinOrderPrice.ToInt(0); literal2.Text = $"¥<em>{num2.ToString()}</em>起送"; if (storeProduct.StoreInfo.Delivery.StoreFreight > decimal.Zero) { Literal literal3 = this.ltlDeliveryDetail; string text2 = literal3.Text; num2 = storeProduct.StoreInfo.Delivery.StoreFreight.ToInt(0); literal3.Text = text2 + $",配送费¥<em>{num2.ToString()}</em>"; } else { Literal literal4 = this.ltlDeliveryDetail; literal4.Text += string.Format(",免配送费"); } } else if (storeProduct.StoreInfo.Delivery.StoreFreight > decimal.Zero) { this.ltlDeliveryDetail.Text = $"配送费¥<em>{storeProduct.StoreInfo.Delivery.StoreFreight.ToInt(0)}</em>"; } else { this.ltlDeliveryDetail.Text = string.Format("免配送费"); } } this.ltlStoreAddress = (Literal)this.FindControl("ltlStoreAddress"); this.ltlStoreAddress.Text = storeProduct.StoreInfo.AddressSimply; this.hidLngLat.Value = $"{storeProduct.StoreInfo.Position.Longitude},{storeProduct.StoreInfo.Position.Latitude}"; this.hidStoreName.Value = storeProduct.StoreInfo.StoreName; this.hdQQMapKey.Value = masterSettings.QQMapAPIKey; this.hdTitle.Value = Globals.StripAllTags(string.IsNullOrEmpty(storeProduct.Title) ? storeProduct.ProductName : storeProduct.Title); this.hdDesc.Value = Globals.StripAllTags(string.IsNullOrEmpty(storeProduct.ShortDescription) ? this.hdTitle.Value : storeProduct.ShortDescription); string oldValue = "/storage/master/product/images/"; string newValue = "/storage/master/product/thumbs410/410_"; string text3 = storeProduct.ImgUrlList[0]; if (!string.IsNullOrEmpty(text3)) { text3 = text3.ToLower().Replace(oldValue, newValue); } string local = string.IsNullOrEmpty(text3) ? SettingsManager.GetMasterSettings().DefaultProductImage : text3; this.hdImgUrl.Value = Globals.FullPath(local); this.hdLink.Value = Globals.FullPath(HttpContext.Current.Request.Url.ToString()); } this.litHasCollected.SetWhenIsNotNull(storeProduct.IsFavorite ? "1" : "0"); PageTitle.AddSiteNameTitle(storeProduct.ProductName); this.ProcessException(storeProduct); return; IL_07c7: num = 1; goto IL_07c8; }
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(); } } } }
protected override void AttachChildControls() { if (!int.TryParse(base.GetParameter("groupBuyId", false), out this.groupBuyId)) { base.GotoResourceNotFound(); } this.ltlConsultation = (Literal)this.FindControl("ltlConsultation"); this.ltlSaleCount = (Literal)this.FindControl("ltlSaleCount"); this.common_Location = (Common_Location)this.FindControl("common_Location"); 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 = (Label)this.FindControl("litWeight"); this.litBrosedNum = (Literal)this.FindControl("litBrosedNum"); this.litBrand = (Literal)this.FindControl("litBrand"); this.litContent = (Literal)this.FindControl("litContent"); 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.ltlReviewCount = (Literal)this.FindControl("ltlReviewCount"); this.txtMaxCount = (HtmlInputHidden)this.FindControl("txtMaxCount"); this.txtSoldCount = (HtmlInputHidden)this.FindControl("txtSoldCount"); this.hidden_IsOver = (HtmlInputHidden)this.FindControl("hidden_IsOver"); this.hidden_GroupBuyId = (HtmlInputHidden)this.FindControl("hidden_GroupBuyId"); this.hidden_productId = (HtmlInputHidden)this.FindControl("hidden_productId"); this.lblCurrentSalePrice = (FormatedMoneyLabel)this.FindControl("lblCurrentSalePrice"); this.litCount = (Label)this.FindControl("litCount"); this.lblNeedPrice = (FormatedMoneyLabel)this.FindControl("lblNeedPrice"); this.lblEndTime = (FormatedTimeLabel)this.FindControl("lblEndTime"); this.lblStartTime = (FormatedTimeLabel)this.FindControl("lblStartTime"); this.litRemainTime = (Literal)this.FindControl("litRemainTime"); this.litNeedCount = (Literal)this.FindControl("litNeedCount"); this.litMaxCount = (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.consultations = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations"); this.correlative = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative"); this.nowTime = (HtmlInputHidden)this.FindControl("nowTime"); this.nowTime.SetWhenIsNotNull(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo)); this.hidden_skus = (HtmlInputHidden)this.FindControl("hidden_skus"); this.hidden_skuItem = (HtmlInputHidden)this.FindControl("hidden_skuItem"); if (!this.Page.IsPostBack) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(this.groupBuyId); if (groupBuy == null) { base.GotoResourceNotFound(); } HtmlInputHidden htmlInputHidden = this.hidden_GroupBuyId; int num = groupBuy.GroupBuyId; htmlInputHidden.Value = num.ToString(); ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(groupBuy.ProductId, null, masterSettings.OpenMultStore, 0); Literal literal = this.ltlSaleCount; num = productBrowseInfo.SaleCount; literal.Text = num.ToString(); if (productBrowseInfo.Product == null) { this.hidden_IsOver.Value = "pullOff"; } else if (!productBrowseInfo.Product.SaleStatus.Equals(ProductSaleStatus.OnSale)) { this.hidden_IsOver.Value = "pullOff"; } if (productBrowseInfo.Product == null || groupBuy == null) { this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品参与的团购活动已经结束;或已被管理员删除")); } else { if (groupBuy != null) { if (groupBuy.Status != GroupBuyStatus.UnderWay) { this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该团购活动已经结束")); return; } HtmlInputHidden htmlInputHidden2 = this.hidden_productId; num = groupBuy.ProductId; htmlInputHidden2.Value = num.ToString(); if (groupBuy.StartDate > DateTime.Now) { this.hidden_IsOver.Value = "AboutToBegin"; } else if (groupBuy.EndDate < DateTime.Now) { this.hidden_IsOver.Value = "over"; } } Literal literal2 = this.ltlConsultation; num = productBrowseInfo.ConsultationCount; literal2.Text = num.ToString(); Literal literal3 = this.ltlReviewCount; num = productBrowseInfo.ReviewCount; literal3.Text = num.ToString(); 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.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName); this.LoadProductGroupBuyInfo(groupBuy); this.btnOrder.Stock = productBrowseInfo.Product.Stock; BrowsedProductQueue.EnQueue(groupBuy.ProductId); this.images.ImageInfo = productBrowseInfo.Product; this.litContent.Text = groupBuy.Content; if (productBrowseInfo.DbAttribute != null) { this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute; this.rptExpandAttributes.DataBind(); } if (productBrowseInfo.DbSKUs != null) { this.skuSelector.ProductId = groupBuy.ProductId; this.skuSelector.DataSource = productBrowseInfo.DbSKUs; } if (productBrowseInfo.DBConsultations != null) { this.consultations.DataSource = productBrowseInfo.DBConsultations; this.consultations.DataBind(); } if (productBrowseInfo.DbCorrelatives != null) { this.correlative.DataSource = productBrowseInfo.DbCorrelatives; this.correlative.DataBind(); } } } }
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 = "该商品已经下架"; } } } }
protected override void AttachChildControls() { this.hidSupplier = (HtmlInputHidden)this.FindControl("hidSupplier"); this.litSupplierName = (Literal)this.FindControl("litSupplierName"); this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.divFightGroupsHead = (HtmlControl)this.FindControl("divFightGroupsHead"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.fightGroupActivityId = this.Page.Request["fightGroupActivityId"].ToInt(0); this.litJoinNumber = (Literal)this.FindControl("litJoinNumber"); this.litLimitedHour = (Literal)this.FindControl("litLimitedHour"); this.litEndDate = (Literal)this.FindControl("litEndDate"); this.litProductName = (Literal)this.FindControl("litProductName"); this.litFGAPrice = (Literal)this.FindControl("litFGAPrice"); this.litPPrice = (Literal)this.FindControl("litPPrice"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.imgEnd = (Image)this.FindControl("imgEnd"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.rptFightGroups = (WapTemplatedRepeater)this.FindControl("rptFightGroups"); this.litMinPrice = (Literal)this.FindControl("litMinPrice"); this.litProductPrice = (Literal)this.FindControl("litProductPrice"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.divGetBySelf = (HtmlControl)this.FindControl("divGetBySelf"); this.hiddenProductId = (HtmlInputText)this.FindControl("hiddenProductId"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(this.fightGroupActivityId); if (fightGroupActivitieInfo != null) { HtmlInputText htmlInputText = this.hiddenProductId; int num = fightGroupActivitieInfo.ProductId; htmlInputText.Value = num.ToString(); this.fightGroupRule.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; if (fightGroupActivitieInfo.StartDate > DateTime.Now) { this.Page.Response.Redirect("FightGroupActivityDetailsSoon.aspx?fightGroupActivityId=" + this.fightGroupActivityId); } SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings.OpenMultStore && StoresHelper.ProductHasStores(fightGroupActivitieInfo.ProductId)) { this.divGetBySelf.Visible = true; } this.skuSubmitOrder.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(this.fightGroupActivityId); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroupActivitieInfo.ProductId}"; this.imgEnd.Visible = (fightGroupActivitieInfo.EndDate < DateTime.Now); Literal literal = this.litJoinNumber; num = fightGroupActivitieInfo.JoinNumber; literal.Text = num.ToString(); Literal literal2 = this.litLimitedHour; num = fightGroupActivitieInfo.LimitedHour; literal2.Text = num.ToString(); this.litEndDate.Text = fightGroupActivitieInfo.EndDate.ToString("yy.MM.dd"); this.litProductName.Text = fightGroupActivitieInfo.ProductName; decimal num2 = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice); this.litFGAPrice.Text = num2.F2ToString("f2"); if (fightGroupSkus.Count() > 1) { decimal num3 = fightGroupSkus.Max((FightGroupSkuInfo c) => c.SalePrice); if (num3 > num2) { this.litFGAPrice.Text = num2.F2ToString("f2") + "~" + num3.F2ToString("f2"); } } this.litMinPrice.Text = num2.F2ToString("f2"); IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroupActivitieInfo.ProductId, out dictionary, out list); if (productDetails != null) { this.skuSubmitOrder.ProductInfo = productDetails; this.litPPrice.Text = MemberProcessor.GetMemberPrice(productDetails).F2ToString("f2"); this.litProductPrice.Text = this.litPPrice.Text; } int supplierId = productDetails.SupplierId; if (supplierId > 0) { SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId); if (supplierById != null) { this.hidSupplier.Value = "true"; this.litSupplierName.Text = supplierById.SupplierName; } } else { this.hidSupplier.Value = "false"; } Literal literal3 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroupActivitieInfo.ProductId }).TotalRecords; literal3.Text = num.ToString(); DataTable fightGroups = VShopHelper.GetFightGroups(this.fightGroupActivityId); for (int i = 0; i < fightGroups.Rows.Count; i++) { fightGroups.Rows[i]["Name"] = DataHelper.GetHiddenUsername(fightGroups.Rows[i]["Name"].ToString()); } this.divFightGroupsHead.Visible = (fightGroups.Rows.Count > 0); this.rptFightGroups.DataSource = fightGroups; this.rptFightGroups.DataBind(); this.hdAppId.Value = base.site.WeixinAppId; if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareTitle)) { this.hdTitle.Value = (string.IsNullOrEmpty(productDetails.Title) ? productDetails.ProductName : productDetails.Title); } else { this.hdTitle.Value = fightGroupActivitieInfo.ShareTitle.Trim(); } if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareContent.Trim())) { this.hdDesc.Value = productDetails.Meta_Description; } else { this.hdDesc.Value = fightGroupActivitieInfo.ShareContent.Trim(); } string local = string.IsNullOrEmpty(fightGroupActivitieInfo.Icon) ? SettingsManager.GetMasterSettings().DefaultProductImage : fightGroupActivitieInfo.Icon; this.hdImgUrl.Value = Globals.FullPath(local); this.hdLink.Value = Globals.FullPath(this.Page.Request.Url.ToString()); if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(productDetails.ImageUrl1) && string.IsNullOrEmpty(productDetails.ImageUrl2) && string.IsNullOrEmpty(productDetails.ImageUrl3) && string.IsNullOrEmpty(productDetails.ImageUrl4) && string.IsNullOrEmpty(productDetails.ImageUrl5)) { productDetails.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(fightGroupActivitieInfo.ProductId); List <SlideImage> list2 = new List <SlideImage>(); list2.Add(new SlideImage(productDetails.ImageUrl1, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl2, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl3, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl4, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list2 where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); Literal control = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, false); control.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { string text = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex.Replace(productDetails.Description, ""); } text = text.Replace("src", "data-url"); this.litDescription.Text = text; } DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery { ProductId = productDetails.ProductId, PageIndex = 1, PageSize = 2147483647, SortOrder = SortAction.Desc, SortBy = "ConsultationId", HasReplied = true }).Data; for (int j = 0; j < data.Rows.Count; j++) { data.Rows[j]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[j]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = data; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = data.IsNullOrEmpty(); } } else { base.GotoResourceNotFound("活动不存在"); } }
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; } }
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(); } } } }
protected override void AttachChildControls() { this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.divFightGroupsHead = (HtmlControl)this.FindControl("divFightGroupsHead"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.fightGroupActivityId = this.Page.Request["fightGroupActivityId"].ToInt(0); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litJoinNumber = (Literal)this.FindControl("litJoinNumber"); this.litStartDate = (Literal)this.FindControl("litStartDate"); this.litProductName = (Literal)this.FindControl("litProductName"); this.litFGAPrice = (Literal)this.FindControl("litFGAPrice"); this.litPPrice = (Literal)this.FindControl("litPPrice"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.imgEnd = (Image)this.FindControl("imgEnd"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.rptFightGroups = (WapTemplatedRepeater)this.FindControl("rptFightGroups"); this.litProductPrice = (Literal)this.FindControl("litProductPrice"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.divGetBySelf = (HtmlControl)this.FindControl("divGetBySelf"); FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(this.fightGroupActivityId); if (fightGroupActivitieInfo != null) { if (fightGroupActivitieInfo.StartDate <= DateTime.Now) { HiContext.Current.Context.Response.Redirect("FightGroupActivityDetails?fightGroupActivityId=" + fightGroupActivitieInfo.FightGroupActivityId); } this.fightGroupRule.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings.OpenMultStore && StoresHelper.ProductHasStores(fightGroupActivitieInfo.ProductId)) { this.divGetBySelf.Visible = true; } IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(this.fightGroupActivityId); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroupActivitieInfo.ProductId}"; this.imgEnd.Visible = (fightGroupActivitieInfo.EndDate < DateTime.Now); Literal literal = this.litJoinNumber; int num = fightGroupActivitieInfo.JoinNumber; literal.Text = num.ToString(); this.litStartDate.Text = fightGroupActivitieInfo.StartDate.ToString("yyyy-MM-dd HH:mm:ss"); this.litProductName.Text = fightGroupActivitieInfo.ProductName; decimal num2 = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice); this.litFGAPrice.Text = num2.F2ToString("f2"); if (fightGroupSkus.Count() > 1) { decimal num3 = fightGroupSkus.Max((FightGroupSkuInfo c) => c.SalePrice); if (num3 > num2) { this.litFGAPrice.Text = num2.F2ToString("f2") + "~" + num3.F2ToString("f2"); } } IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroupActivitieInfo.ProductId, out dictionary, out list); if (productDetails != null) { this.litPPrice.Text = productDetails.MaxSalePrice.F2ToString("f2"); this.litProductPrice.Text = this.litPPrice.Text; this.skuSubmitOrder.ProductInfo = productDetails; } this.skuSubmitOrder.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; Literal literal2 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroupActivitieInfo.ProductId }).TotalRecords; literal2.Text = num.ToString(); DataTable fightGroups = VShopHelper.GetFightGroups(this.fightGroupActivityId); for (int i = 0; i < fightGroups.Rows.Count; i++) { fightGroups.Rows[i]["Name"] = DataHelper.GetHiddenUsername(fightGroups.Rows[i]["Name"].ToString()); } this.divFightGroupsHead.Visible = (fightGroups.Rows.Count > 0); this.rptFightGroups.DataSource = fightGroups; this.rptFightGroups.DataBind(); if (this.rptProductImages != null) { string locationUrl = "javascript:;"; if (string.IsNullOrEmpty(productDetails.ImageUrl1) && string.IsNullOrEmpty(productDetails.ImageUrl2) && string.IsNullOrEmpty(productDetails.ImageUrl3) && string.IsNullOrEmpty(productDetails.ImageUrl4) && string.IsNullOrEmpty(productDetails.ImageUrl5)) { productDetails.ImageUrl1 = masterSettings.DefaultProductImage; } DataTable skus = ProductBrowser.GetSkus(fightGroupActivitieInfo.ProductId); List <SlideImage> list2 = new List <SlideImage>(); foreach (DataRow row in skus.Rows) { List <SlideImage> list3 = (from s in list2 where s.ImageUrl == row["ThumbnailUrl410"].ToString() select s).ToList(); if (list3.Count <= 0) { list2.Add(new SlideImage(row["ThumbnailUrl410"].ToString(), locationUrl)); } } list2.Add(new SlideImage(productDetails.ImageUrl1, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl2, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl3, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl4, locationUrl)); list2.Add(new SlideImage(productDetails.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list2 where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); Literal control = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, true); control.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { string text = ""; Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex.Replace(productDetails.Description, ""); } text = text.Replace("src", "data-url"); this.litDescription.Text = text; } } DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery { ProductId = productDetails.ProductId, PageIndex = 1, PageSize = 2147483647, SortOrder = SortAction.Desc, SortBy = "ConsultationId" }).Data; for (int j = 0; j < data.Rows.Count; j++) { data.Rows[j]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[j]["UserName"].ToNullString()); } this.rptProductConsultations.DataSource = data; this.rptProductConsultations.DataBind(); this.divConsultationEmpty.Visible = data.IsNullOrEmpty(); } else { base.GotoResourceNotFound("活动不存在"); } }
protected override void AttachChildControls() { if (!int.TryParse(base.GetParameter("productId", false), out this.productId)) { base.GotoResourceNotFound(); } this.hidSupName = (HtmlInputHidden)this.FindControl("hidSupName"); this.litSupplierName = (Literal)this.FindControl("litSupplierName"); this.hiddenpid = (HtmlInputHidden)this.FindControl("hiddenpid"); this.hidCartQuantity = (HtmlInputHidden)this.FindControl("txCartQuantity"); this.hiddenpid.Value = this.productId.ToString(); this.common_Location = (Common_Location)this.FindControl("common_Location"); this.litProductName = (Literal)this.FindControl("litProductName"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (Literal)this.FindControl("litUnit"); this.litSaleCounts = (Literal)this.FindControl("litSaleCounts"); this.lblMarkerPrice = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice"); this.lblBuyPrice = (Label)this.FindControl("lblBuyPrice"); this.lblTotalPrice = (TotalLabel)this.FindControl("lblTotalPrice"); this.lblSku = (SkuLabel)this.FindControl("lblSku"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.btnBuy = (BuyButton)this.FindControl("btnBuy"); this.btnaddgouwu = (AddCartButton)this.FindControl("btnaddgouwu"); this.hpkProductConsultations = (HyperLink)this.FindControl("hpkProductConsultations"); this.ltlSaleCount = (Literal)this.FindControl("ltlSaleCount"); this.ltlReviewCount = (Literal)this.FindControl("ltlReviewCount"); this.litReviewCount = (Literal)this.FindControl("litReviewCount"); this.ltlConsultation = (Literal)this.FindControl("ltlConsultation"); this.images = (Common_ProductImages)this.FindControl("common_ProductImages"); this.rptExpandAttributes = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes"); this.rptOnlineService = (ThemedTemplatedRepeater)this.FindControl("rptOnlineService"); this.skuSelector = (SKUSelector)this.FindControl("SKUSelector"); 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 = (HtmlInputHidden)this.FindControl("hidden_skus"); this.hidden_skuItem = (HtmlInputHidden)this.FindControl("hidden_skuItem"); this.hidIsOpenMultiStore = (HtmlInputHidden)this.FindControl("hidIsOpenMultiStore"); this.aCountDownUrl = (HyperLink)this.FindControl("aCountDownUrl"); this.imgQrCode = (Image)this.FindControl("imgQrCode"); this.phonePriceQrCode = (Image)this.FindControl("phonePriceQrCode"); this.liCode = (HtmlGenericControl)this.FindControl("liCode"); this.hidden_productId = (HtmlInputHidden)this.FindControl("hidden_productId"); this.hidHasStores = (HtmlInputHidden)this.FindControl("hidHasStores"); this.divGift = (HtmlGenericControl)this.FindControl("divGift"); this.ltlGiftName = (Literal)this.FindControl("ltlGiftName"); this.ltlGiftNum = (Literal)this.FindControl("ltlGiftNum"); this.aBrand = (HtmlAnchor)this.FindControl("aBrand"); this.imgBrand = (HiImage)this.FindControl("imgBrand"); this.imgpdorequest = (HtmlImage)this.FindControl("imgpdorequest"); this.imgTakeonstore = (HtmlImage)this.FindControl("imgTakeonstore"); this.imgCustomerService = (HtmlImage)this.FindControl("imgCustomerService"); this.ltlOrderPromotion = (Literal)this.FindControl("ltlOrderPromotion"); this.ltlOrderPromotion_free = (Literal)this.FindControl("ltlOrderPromotion_free"); this.divOrderPromotions = (HtmlGenericControl)this.FindControl("divOrderPromotions"); this.divOrderPromotions2 = (HtmlGenericControl)this.FindControl("divOrderPromotions2"); this.divOrderPromotions3 = (HtmlGenericControl)this.FindControl("divOrderPromotions3"); this.divPhonePrice = (HtmlGenericControl)this.FindControl("divPhonePrice"); this.litPhonePrice = (Literal)this.FindControl("litPhonePrice"); this.litPhonePriceEndDate = (Literal)this.FindControl("litPhonePriceEndDate"); this.divCuxiao = (HtmlGenericControl)this.FindControl("divCuxiao"); this.ltlUnit = (Literal)this.FindControl("ltlUnit"); this.divProductReferral = (HtmlGenericControl)this.FindControl("divProductReferral"); this.ltlProductSendGifts = (Literal)this.FindControl("ltlProductSendGifts"); this.setDeliverRegion = (Common_SetDeliveryRegion)this.FindControl("setDeliverRegion"); this.hidShowCombinationBuy = (HtmlInputHidden)this.FindControl("hidShowCombinationBuy"); this.hidCombinationId = (HtmlInputHidden)this.FindControl("hidCombinationId"); this.imgMainPic = (HtmlImage)this.FindControl("imgMainPic"); this.divqq = (HtmlGenericControl)this.FindControl("divqq"); HtmlAnchor htmlAnchor = (HtmlAnchor)this.FindControl("aMainName"); this.lblMainPrice = (Label)this.FindControl("lblMainPrice"); ThemedTemplatedRepeater themedTemplatedRepeater = (ThemedTemplatedRepeater)this.FindControl("rptOtherProducts"); this.spdiscount = (HtmlGenericControl)this.FindControl("spdiscount"); this.aCountDownUrl.Visible = false; this.buyProduct = (HtmlTableRow)this.FindControl("buyProduct"); this.serviceProduct = (HtmlTableRow)this.FindControl("serviceProduct"); if (this.Page.IsPostBack) { return; } SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (this.spdiscount != null && HiContext.Current.User.UserId > 0) { MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(HiContext.Current.User.GradeId); this.spdiscount.Visible = true; this.spdiscount.InnerHtml = "<strong class='vip_price'><img src='/templates/pccommon/images/vip_price.png' />" + memberGrade.Name + "价</strong>"; } if (this.imgQrCode != null) { string text = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png"; Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text, false, ImageFormats.Png); this.imgQrCode.ImageUrl = text; } if (this.phonePriceQrCode != null) { string text2 = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png"; Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text2, false, ImageFormats.Png); this.phonePriceQrCode.ImageUrl = text2; } if (this.liCode != null && HiContext.Current.SiteSettings.OpenAliho == 0 && HiContext.Current.SiteSettings.OpenVstore == 0 && HiContext.Current.SiteSettings.OpenWap == 0 && HiContext.Current.SiteSettings.OpenMobbile == 0) { this.liCode.Visible = false; } ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, this.sitesettings.OpenMultStore, 0); if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete) { this.Page.Response.Redirect("/ProductDelete.aspx"); return; } if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale) { this.Page.Response.Redirect(base.GetRouteUrl("unproductdetails", new { ProductId = this.productId })); } if (productBrowseInfo.Product.SupplierId > 0 && productBrowseInfo.Product.AuditStatus != ProductAuditStatus.Pass) { this.Page.Response.Redirect(base.GetRouteUrl("unproductdetailsaudit", new { ProductId = this.productId })); } if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock) { this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库")); return; } this.setDeliverRegion.ShippingTemplateId = productBrowseInfo.Product.ShippingTemplateId; this.setDeliverRegion.Volume = productBrowseInfo.Product.Weight; this.setDeliverRegion.Weight = productBrowseInfo.Product.Weight; this.ActivityBusiness(); if (this.hidCartQuantity != null) { this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(productBrowseInfo.Product.ProductId); } 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.hidden_productId.Value = this.productId.ToString(); this.LoadPageSearch(productBrowseInfo.Product); if (this.lbUserProductRefer != null && this.sitesettings.OpenReferral == 1 && this.sitesettings.ShowDeductInProductPage) { this.lbUserProductRefer.product = productBrowseInfo.Product; } HyperLink hyperLink = this.hpkProductConsultations; int num = productBrowseInfo.ConsultationCount; hyperLink.Text = "查看全部" + num.ToString() + "条咨询"; Literal literal = this.ltlConsultation; num = productBrowseInfo.ConsultationCount; literal.Text = num.ToString(); Literal literal2 = this.ltlSaleCount; num = productBrowseInfo.SaleCount; literal2.Text = num.ToString(); Literal literal3 = this.ltlReviewCount; num = productBrowseInfo.ReviewCount; literal3.Text = num.ToString(); Literal literal4 = this.litReviewCount; num = productBrowseInfo.ReviewCount; literal4.Text = num.ToString(); this.hpkProductConsultations.NavigateUrl = $"ProductConsultationsAndReplay.aspx?productId={this.productId}"; this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName); this.btnBuy.Stock = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock); this.ltlUnit.Text = productBrowseInfo.Product.Unit; this.divqq.Visible = (this.sitesettings.ServiceIsOpen == "1"); MemberInfo user = HiContext.Current.User; if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productBrowseInfo.Product.SubMemberDeduct.HasValue)) { if (!productBrowseInfo.Product.SubMemberDeduct.HasValue) { goto IL_0c9e; } decimal?subMemberDeduct = productBrowseInfo.Product.SubMemberDeduct; if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue) { goto IL_0c9e; } } goto IL_0cd8; IL_0cd9: int num2; if (num2 != 0) { this.divProductReferral.Visible = false; } this.btnaddgouwu.Stock = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock); 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; } int supplierId = productBrowseInfo.Product.SupplierId; if (supplierId > 0) { SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId); if (!string.IsNullOrEmpty(supplierById.Picture)) { this.imgBrand.ImageUrl = supplierById.Picture; } else if (productBrowseInfo.Product.BrandId.HasValue) { BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value); if (brandCategory != null && !string.IsNullOrEmpty(brandCategory.Logo)) { this.imgBrand.ImageUrl = brandCategory.Logo; this.aBrand.HRef = base.GetRouteUrl("branddetails", new { brandId = brandCategory.BrandId }); } } else { this.imgBrand.Visible = false; } this.litSupplierName.Text = "<a href=\"/SupplierAbout?SupplierId=" + supplierById.SupplierId + "\">" + supplierById.SupplierName + "</a>"; this.hidSupName.Value = supplierById.SupplierName; } else { this.litSupplierName.Visible = false; if (productBrowseInfo.Product.BrandId.HasValue) { BrandCategoryInfo brandCategory2 = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value); if (brandCategory2 != null && !string.IsNullOrEmpty(brandCategory2.Logo)) { this.imgBrand.ImageUrl = brandCategory2.Logo; this.aBrand.HRef = base.GetRouteUrl("branddetails", new { brandId = brandCategory2.BrandId }); } } } if (SalesHelper.IsSupportPodrequest() && productBrowseInfo.Product.SupplierId == 0) { this.imgpdorequest.Visible = true; } if (masterSettings.OpenMultStore) { if (StoresHelper.ProductInStoreAndIsAboveSelf(this.productId)) { this.imgTakeonstore.Visible = true; } } else if (masterSettings.IsOpenPickeupInStore && productBrowseInfo.Product.SupplierId == 0) { this.imgTakeonstore.Visible = true; } if (productBrowseInfo.DBConsultations != null) { this.consultations.DataSource = productBrowseInfo.DBConsultations; this.consultations.DataBind(); } if (productBrowseInfo.DbCorrelatives != null) { this.correlative.DataSource = productBrowseInfo.DbCorrelatives; this.correlative.DataBind(); } this.BindOrderPromotions(); if (!this.divOrderPromotions.Visible && !this.divOrderPromotions2.Visible && !this.divOrderPromotions3.Visible && !this.divPhonePrice.Visible) { this.divCuxiao.Style.Add("display", "none"); } if (this.rptOnlineService != null) { IList <OnlineServiceInfo> allOnlineService = OnlineServiceHelper.GetAllOnlineService(0, 1); IList <OnlineServiceInfo> allOnlineService2 = OnlineServiceHelper.GetAllOnlineService(0, 2); if (allOnlineService2 != null) { foreach (OnlineServiceInfo item in allOnlineService2) { allOnlineService.Add(item); } } this.rptOnlineService.DataSource = allOnlineService; this.rptOnlineService.DataBind(); } if (productBrowseInfo.Product.Stock > 0) { CombinationBuyInfo combinationBuyByMainProductId = CombinationBuyHelper.GetCombinationBuyByMainProductId(this.productId); if (combinationBuyByMainProductId != null) { List <CombinationBuyandProductUnionInfo> combinationProductListByProductId = CombinationBuyHelper.GetCombinationProductListByProductId(this.productId); CombinationBuyandProductUnionInfo combinationBuyandProductUnionInfo = combinationProductListByProductId.FirstOrDefault((CombinationBuyandProductUnionInfo c) => c.ProductId == this.productId); if (combinationBuyandProductUnionInfo != null) { HtmlInputHidden htmlInputHidden = this.hidCombinationId; num = combinationBuyandProductUnionInfo.CombinationId; htmlInputHidden.Value = num.ToString(); string value2 = string.IsNullOrEmpty(combinationBuyandProductUnionInfo.ThumbnailUrl100) ? this.sitesettings.DefaultProductThumbnail3 : combinationBuyandProductUnionInfo.ThumbnailUrl100; this.imgMainPic.Attributes["data-url"] = value2; htmlAnchor.InnerText = combinationBuyandProductUnionInfo.ProductName; this.lblMainPrice.Text = combinationBuyandProductUnionInfo.MinCombinationPrice.F2ToString("f2"); this.lblMainPrice.Attributes["salePrice"] = combinationBuyandProductUnionInfo.MinSalePrice.F2ToString("f2"); } combinationProductListByProductId.Remove(combinationBuyandProductUnionInfo); if (combinationProductListByProductId != null && combinationProductListByProductId.Count > 0) { for (int i = 0; i < combinationProductListByProductId.Count; i++) { string thumbnailUrl = string.IsNullOrEmpty(combinationProductListByProductId[i].ThumbnailUrl100) ? this.sitesettings.DefaultProductThumbnail3 : combinationProductListByProductId[i].ThumbnailUrl100; combinationProductListByProductId[i].ThumbnailUrl100 = thumbnailUrl; combinationProductListByProductId[i].Index = i + 1; } themedTemplatedRepeater.DataSource = combinationProductListByProductId; themedTemplatedRepeater.DataBind(); this.hidShowCombinationBuy.Value = "1"; } } } return; IL_0cd8: num2 = 1; goto IL_0cd9; IL_0c9e: if (HiContext.Current.SiteSettings.OpenReferral == 1 && HiContext.Current.SiteSettings.ShowDeductInProductPage && user.Referral != null) { num2 = (user.Referral.IsRepeled ? 1 : 0); goto IL_0cd9; } goto IL_0cd8; }