private DataGridViewModel <Dictionary <string, object> > GetDataList() { DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >(); IList <OnlineServiceInfo> allOnlineService = OnlineServiceHelper.GetAllOnlineService(0, -1); dataGridViewModel.rows = new List <Dictionary <string, object> >(); foreach (OnlineServiceInfo item in allOnlineService) { Dictionary <string, object> dictionary = item.ToDictionary(); dictionary.Add("ServiceTypeName", EnumDescription.GetEnumDescription((Enum)(object)(OnlineServiceTypes)item.ServiceType, 0)); dataGridViewModel.rows.Add(dictionary); } dataGridViewModel.total = dataGridViewModel.rows.Count; return(dataGridViewModel); }
protected override void AttachChildControls() { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings.ServiceIsOpen == "1") { this.repOnlineService = (Repeater)this.FindControl("repOnlineService"); this.hidPosition = (HtmlInputHidden)this.FindControl("hidPosition"); this.hidYPostion = (HtmlInputHidden)this.FindControl("hidYPostion"); if (this.hidPosition != null) { this.hidPosition.Value = masterSettings.ServicePosition.ToString(); } if (this.hidYPostion != null) { this.hidYPostion.Value = masterSettings.ServiceCoordinate; } if (this.repOnlineService != 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.repOnlineService.DataSource = allOnlineService; this.repOnlineService.DataBind(); } else { Literal literal = (Literal)this.FindControl("litOnlineServer"); literal.Text = HiContext.Current.SiteSettings.HtmlOnlineServiceCode; } } else { this.Visible = false; } }
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() { 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() { 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; }