private void FindControls() { this.rptProductImages = (AppshopTemplatedRepeater)this.FindControl("rptProductImages"); this.litProdcutName = (Literal)this.FindControl("litProdcutName"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litSoldCount = (Literal)this.FindControl("soldCount"); this.litprice = (Literal)this.FindControl("price"); this.litcontent = (Literal)this.FindControl("content"); this.litminCount = (Literal)this.FindControl("minCount"); this.litGroupBuyId = (HtmlInputControl)this.FindControl("litGroupbuyId"); this.hidden_IsOver = (HtmlInputHidden)this.FindControl("hidden_IsOver"); this.litLeftSeconds = (Literal)this.FindControl("leftSeconds"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.salePrice = (Literal)this.FindControl("salePrice"); this.leftCount = (Literal)this.FindControl("leftCount"); this.minSuccessCount = (Literal)this.FindControl("minSuccessCount"); this.txtProductId = (HtmlInputControl)this.FindControl("txtProductId"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litReviewsCount = (Literal)this.FindControl("litReviewsCount"); this.litMaxCount = (Literal)this.FindControl("litMaxCount"); this.startTime = (HtmlInputHidden)this.FindControl("startTime"); this.endTime = (HtmlInputHidden)this.FindControl("endTime"); this.groupBuySoldCount = (HtmlInputHidden)this.FindControl("groupBuySoldCount"); this.groupBuyMinCount = (HtmlInputHidden)this.FindControl("groupBuyMinCount"); this.litGroupbuyDescription = (Literal)this.FindControl("litGroupbuyDescription"); this.groupBuyMaxCount = (HtmlInputHidden)this.FindControl("groupBuyMaxCount"); this.skuStock = (HtmlInputHidden)this.FindControl("skuStock"); this.hiddenIsLogin = (HtmlInputHidden)this.FindControl("hiddenIsLogin"); this.hdCountDownId = (HtmlInputHidden)this.FindControl("hdCountDownId"); this.litUnit = (Literal)this.FindControl("litUnit"); }
private void FindControls() { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); this.rptProductImages = (AppshopTemplatedRepeater)this.FindControl("rptProductImages"); this.litProdcutName = (Literal)this.FindControl("litProdcutName"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litSoldCount = (Literal)this.FindControl("soldCount"); this.litprice = (Literal)this.FindControl("price"); this.litcontent = (Literal)this.FindControl("content"); this.litminCount = (Literal)this.FindControl("minCount"); this.litGroupBuyId = (HtmlInputControl)this.FindControl("litGroupbuyId"); this.litLeftSeconds = (Literal)this.FindControl("leftSeconds"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.salePrice = (Literal)this.FindControl("salePrice"); this.leftCount = (Literal)this.FindControl("leftCount"); this.minSuccessCount = (Literal)this.FindControl("minSuccessCount"); this.txtProductId = (HtmlInputControl)this.FindControl("txtProductId"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litReviewsCount = (Literal)this.FindControl("litReviewsCount"); this.litMaxCount = (Literal)this.FindControl("litMaxCount"); this.startTime = (HtmlInputHidden)this.FindControl("startTime"); this.endTime = (HtmlInputHidden)this.FindControl("endTime"); this.groupBuySoldCount = (HtmlInputHidden)this.FindControl("groupBuySoldCount"); this.groupBuyMinCount = (HtmlInputHidden)this.FindControl("groupBuyMinCount"); this.litGroupbuyDescription = (Literal)this.FindControl("litGroupbuyDescription"); this.groupBuyMaxCount = (HtmlInputHidden)this.FindControl("groupBuyMaxCount"); this.skuStock = (HtmlInputHidden)this.FindControl("skuStock"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTimestamp = (HtmlInputHidden)this.FindControl("hdTimestamp"); this.hdNonceStr = (HtmlInputHidden)this.FindControl("hdNonceStr"); this.hdSignature = (HtmlInputHidden)this.FindControl("hdSignature"); 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.hdSource = (HtmlInputHidden)this.FindControl("hdSource"); this.hdAppId.Value = masterSettings.WeixinAppId; this.litUnit1 = (Literal)this.FindControl("litUnit1"); this.litUnit2 = (Literal)this.FindControl("litUnit2"); this.litUnit3 = (Literal)this.FindControl("litUnit3"); }
private void FindControls() { this.divShortDescription = (HtmlGenericControl)this.FindControl("divShortDescription"); this.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.litProdcutName = (Literal)this.FindControl("litProdcutName"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litSoldCount = (Literal)this.FindControl("soldCount"); this.litprice = (Literal)this.FindControl("price"); this.litcontent = (Literal)this.FindControl("content"); this.litminCount = (Literal)this.FindControl("minCount"); this.litGroupBuyId = (HtmlInputControl)this.FindControl("litGroupbuyId"); this.hidden_IsOver = (HtmlInputHidden)this.FindControl("hidden_IsOver"); this.litLeftSeconds = (Literal)this.FindControl("leftSeconds"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.salePrice = (Literal)this.FindControl("salePrice"); this.leftCount = (Literal)this.FindControl("leftCount"); this.minSuccessCount = (Literal)this.FindControl("minSuccessCount"); this.txtProductId = (HtmlInputControl)this.FindControl("txtProductId"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.litReviewsCount = (Literal)this.FindControl("litReviewsCount"); this.litMaxCount = (Literal)this.FindControl("litMaxCount"); this.startTime = (HtmlInputHidden)this.FindControl("startTime"); this.endTime = (HtmlInputHidden)this.FindControl("endTime"); this.groupBuySoldCount = (HtmlInputHidden)this.FindControl("groupBuySoldCount"); this.groupBuyMinCount = (HtmlInputHidden)this.FindControl("groupBuyMinCount"); this.litGroupbuyDescription = (Literal)this.FindControl("litGroupbuyDescription"); this.groupBuyMaxCount = (HtmlInputHidden)this.FindControl("groupBuyMaxCount"); this.skuStock = (HtmlInputHidden)this.FindControl("skuStock"); this.hiddenIsLogin = (HtmlInputHidden)this.FindControl("hiddenIsLogin"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTimestamp = (HtmlInputHidden)this.FindControl("hdTimestamp"); this.hdNonceStr = (HtmlInputHidden)this.FindControl("hdNonceStr"); this.hdSignature = (HtmlInputHidden)this.FindControl("hdSignature"); 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.hdCountDownId = (HtmlInputHidden)this.FindControl("hdCountDownId"); this.expandAttr = (Common_ExpandAttributes)this.FindControl("ExpandAttributes"); this.litUnit = (Literal)this.FindControl("litUnit"); }
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() { 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() { 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"); int fightGroupId = this.Page.Request["fightGroupId"].ToInt(0); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); this.hfStartTime = (HtmlInputHidden)this.FindControl("hfStartTime"); this.hiddenJoinedUser = (HtmlInputText)this.FindControl("hiddenJoinedUser"); this.hfEndTime = (HtmlInputHidden)this.FindControl("hfEndTime"); this.hfNowTime = (HtmlInputHidden)this.FindControl("hfNowTime"); this.rptFightGroupDetails = (WapTemplatedRepeater)this.FindControl("rptFightGroupDetails"); this.rptFightGroupDetailsNeed = (WapTemplatedRepeater)this.FindControl("rptFightGroupDetailsNeed"); this.litNeedPerson = (Literal)this.FindControl("litNeedPerson"); this.divIn = (HtmlControl)this.FindControl("divIn"); this.divOver = (HtmlControl)this.FindControl("divOver"); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.litJoinNumber = (Literal)this.FindControl("litJoinNumber"); this.litLimitedHour = (Literal)this.FindControl("litLimitedHour"); this.litProductName = (Literal)this.FindControl("litProductName"); this.litFGAPrice = (Literal)this.FindControl("litFGAPrice"); this.litPPrice = (Literal)this.FindControl("litPPrice"); this.imgStatus = (Image)this.FindControl("imgStatus"); this.litRemainTimeHtml = (HtmlGenericControl)this.FindControl("litRemainTimeHtml"); this.spanTime = (HtmlGenericControl)this.FindControl("spanTime"); this.hiddenProductId = (HtmlInputText)this.FindControl("hiddenProductId"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.hidFightGroupActivityStatus = (HtmlInputHidden)this.FindControl("hidFightGroupActivityStatus"); this.divGetBySelf = (HtmlControl)this.FindControl("divGetBySelf"); 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 = base.site.WeixinAppId; FightGroupInfo fightGroup = VShopHelper.GetFightGroup(fightGroupId); if (fightGroup != null) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings.OpenMultStore && StoresHelper.ProductHasStores(fightGroup.ProductId)) { this.divGetBySelf.Visible = true; } if (fightGroup.EndTime <= DateTime.Now && fightGroup.Status == FightGroupStatus.FightGroupIn) { VShopHelper.DealFightGroupFail(fightGroupId); fightGroup.Status = FightGroupStatus.FightGroupFail; } this.fightGroupRule.FightGroupActivityId = fightGroup.FightGroupActivityId; FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); HtmlInputText htmlInputText = this.hiddenProductId; int num = fightGroup.ProductId; htmlInputText.Value = num.ToString(); this.hidFightGroupActivityStatus.Value = ((fightGroupActivitieInfo.EndDate > DateTime.Now) ? "1" : "0"); HtmlInputHidden htmlInputHidden = this.hfNowTime; DateTime dateTime = DateTime.Now; htmlInputHidden.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden2 = this.hfEndTime; dateTime = fightGroup.EndTime; htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); HtmlInputHidden htmlInputHidden3 = this.hfStartTime; dateTime = fightGroup.StartTime; htmlInputHidden3.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroup.ProductId}"; IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(fightGroup.FightGroupActivityId); Literal literal = this.litJoinNumber; num = fightGroup.JoinNumber; literal.Text = num.ToString(); Literal literal2 = this.litLimitedHour; num = fightGroupActivitieInfo.LimitedHour; literal2.Text = num.ToString(); this.litProductName.Text = fightGroup.ProductName; this.litFGAPrice.Text = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice).F2ToString("f2"); IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroup.ProductId, out dictionary, out list); if (productDetails != null) { this.litPPrice.Text = productDetails.MaxSalePrice.F2ToString("f2"); this.skuSubmitOrder.ProductInfo = productDetails; this.skuSubmitOrder.OrderBusiness = 1; this.skuSubmitOrder.FightGroupActivityId = fightGroup.FightGroupActivityId; this.skuSubmitOrder.FightGroupId = fightGroup.FightGroupId; } Literal literal3 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroupActivitieInfo.ProductId }).TotalRecords; literal3.Text = num.ToString(); FightGroupStatus status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupFail)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_fail.png"; this.imgStatus.Attributes.Add("class", "fg_fail"); this.spanTime.Style.Add("text-align", "center"); this.litRemainTimeHtml.Style.Add("display", "none"); } else { status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupSuccess)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_ok.png"; this.imgStatus.Attributes.Add("class", "fg_ok"); } } Image image = this.imgStatus; status = fightGroup.Status; image.Visible = !status.Equals(FightGroupStatus.FightGroupIn); int fightGroupActiveNumber = VShopHelper.GetFightGroupActiveNumber(fightGroup.FightGroupId); int num2 = fightGroup.JoinNumber - fightGroupActiveNumber; num2 = ((num2 >= 0) ? num2 : 0); this.litNeedPerson.Text = num2.ToString(); HtmlControl htmlControl = this.divIn; status = fightGroup.Status; htmlControl.Visible = status.Equals(FightGroupStatus.FightGroupIn); HtmlControl htmlControl2 = this.divOver; status = fightGroup.Status; htmlControl2.Visible = !status.Equals(FightGroupStatus.FightGroupIn); IList <FightGroupUserModel> fightGroupUsers = VShopHelper.GetFightGroupUsers(fightGroup.FightGroupId); foreach (FightGroupUserModel item in fightGroupUsers) { item.Name = DataHelper.GetHiddenUsername(item.Name); if (HiContext.Current.UserId == item.UserId) { this.hiddenJoinedUser.Value = "true"; } } this.rptFightGroupDetails.DataSource = fightGroupUsers; this.rptFightGroupDetails.DataBind(); List <int> list2 = new List <int>(); for (int i = 0; i < num2; i++) { list2.Add(i); } this.rptFightGroupDetailsNeed.DataSource = list2; this.rptFightGroupDetailsNeed.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; } 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> list3 = new List <SlideImage>(); foreach (DataRow row in skus.Rows) { List <SlideImage> list4 = (from s in list3 where s.ImageUrl == row["ThumbnailUrl410"].ToString() select s).ToList(); if (list4.Count <= 0) { list3.Add(new SlideImage(row["ThumbnailUrl410"].ToString(), locationUrl)); } } list3.Add(new SlideImage(productDetails.ImageUrl1, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl2, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl3, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl4, locationUrl)); list3.Add(new SlideImage(productDetails.ImageUrl5, locationUrl)); this.rptProductImages.DataSource = from item in list3 where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); } 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 icon = fightGroupActivitieInfo.Icon; this.hdImgUrl.Value = Globals.FullPath(string.IsNullOrEmpty(icon) ? base.site.DefaultProductThumbnail8 : icon); this.hdLink.Value = Globals.FullPath(this.Page.Request.Url.ToString()); 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() { 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() { this.divConsultationEmpty = (HtmlGenericControl)this.FindControl("divConsultationEmpty"); this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations"); this.fightGroupRule = (Common_FightGroupRule)this.FindControl("fightGroupRule"); this.fightGroupId = this.Page.Request["fightGroupId"].ToInt(0); this.skuSubmitOrder = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder"); this.litDescription = (Literal)this.FindControl("litDescription"); this.litConsultationsCount = (Literal)this.FindControl("litConsultationsCount"); 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.rptProductImages = (WapTemplatedRepeater)this.FindControl("rptProductImages"); this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount"); this.imgStatus = (Image)this.FindControl("imgStatus"); this.hlProductReview = (HyperLink)this.FindControl("hlProductReview"); this.rptMemberGroupDetailsStatus = (WapTemplatedRepeater)this.FindControl("rptMemberGroupDetailsStatus"); FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.fightGroupId); if (fightGroup != null) { if (fightGroup.EndTime <= DateTime.Now && fightGroup.Status == FightGroupStatus.FightGroupIn) { VShopHelper.DealFightGroupFail(fightGroup.FightGroupId); fightGroup.Status = FightGroupStatus.FightGroupFail; } FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(fightGroup.FightGroupActivityId); this.fightGroupRule.FightGroupActivityId = fightGroup.FightGroupActivityId; FightGroupStatus status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupFail)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_fail.png"; this.imgStatus.Attributes.Add("class", "fg_fail"); } else { status = fightGroup.Status; if (status.Equals(FightGroupStatus.FightGroupSuccess)) { this.imgStatus.ImageUrl = "/Templates/common/images/fg_ok.png"; this.imgStatus.Attributes.Add("class", "fg_ok"); } } SiteSettings masterSettings = SettingsManager.GetMasterSettings(); IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(fightGroup.FightGroupActivityId); this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroup.ProductId}"; Literal literal = this.litJoinNumber; int num = fightGroup.JoinNumber; literal.Text = num.ToString(); Literal literal2 = this.litLimitedHour; num = fightGroupActivitieInfo.LimitedHour; literal2.Text = num.ToString(); this.litEndDate.Text = fightGroup.EndTime.ToString("yy.MM.dd"); this.litProductName.Text = fightGroup.ProductName; this.litFGAPrice.Text = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice).F2ToString("f2"); IList <int> list = null; Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >); ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroup.ProductId, out dictionary, out list); if (productDetails != null) { this.litPPrice.Text = productDetails.MaxSalePrice.F2ToString("f2"); this.skuSubmitOrder.ProductInfo = productDetails; } Literal literal3 = this.litProductReviewCount; num = ProductBrowser.GetProductReviews(new ProductReviewQuery { PageIndex = 1, PageSize = 2147483647, ProductId = fightGroup.ProductId }).TotalRecords; literal3.Text = num.ToString(); IList <FightGroupUserModel> fightGroupUsers = VShopHelper.GetFightGroupUsers(fightGroup.FightGroupId); int num2 = fightGroupUsers.Count(); if (fightGroupUsers.Count < fightGroup.JoinNumber) { for (int i = 0; i < fightGroup.JoinNumber - num2; i++) { FightGroupUserModel item2 = new FightGroupUserModel(); fightGroupUsers.Add(item2); } } this.rptMemberGroupDetailsStatus.DataSource = fightGroupUsers; this.rptMemberGroupDetailsStatus.DataBind(); Literal control = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, false); control.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { this.litDescription.Text = regex.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { this.litDescription.Text = regex.Replace(productDetails.Description, ""); } } this.skuSubmitOrder.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId; 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 control2 = this.litConsultationsCount; num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, false); control2.SetWhenIsNotNull(num.ToString()); if (this.litDescription != null) { string text = ""; Regex regex2 = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase); if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription)) { text = regex2.Replace(productDetails.MobbileDescription, ""); } else if (!string.IsNullOrWhiteSpace(productDetails.Description)) { text = regex2.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", Type = ConsultationReplyType.Replyed }).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(); } }