protected override void AttachChildControls() { int num; int num2; int num3; int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId); this.keyWord = this.Page.Request.QueryString["keyWord"]; this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.litContent = (Literal)this.FindControl("litContent"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptGroupBuyProducts"); this.txtTotal = (HtmlInputHidden)this.FindControl("txtTotal"); this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories"); if (this.rptCategories != null) { IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 0x3e8); this.rptCategories.DataSource = maxSubCategories; this.rptCategories.DataBind(); } if (!int.TryParse(this.Page.Request.QueryString["page"], out num)) { num = 1; } if (!int.TryParse(this.Page.Request.QueryString["size"], out num2)) { num2 = 10; } this.rptProducts.DataSource = GroupBuyBrowser.GetGroupBuyProducts(new int?(this.categoryId), this.keyWord, num, num2, out num3, true); this.rptProducts.DataBind(); this.txtTotal.SetWhenIsNotNull(num3.ToString()); PageTitle.AddSiteNameTitle("团购搜索页"); }
private void SetControlsValue(int groupbuyId) { GroupBuyInfo groupBuy = GroupBuyBrowser.GetGroupBuy(groupbuyId); ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), groupBuy.ProductId); if (product == null) { base.GotoResourceNotFound("此商品已不存在"); } if (product.SaleStatus != ProductSaleStatus.OnSale) { base.GotoResourceNotFound("此商品已下架"); } if (this.rptProductImages != null) { string locationUrl = "javascript:;"; SlideImage[] imageArray = new SlideImage[] { new SlideImage(product.ImageUrl1, locationUrl), new SlideImage(product.ImageUrl2, locationUrl), new SlideImage(product.ImageUrl3, locationUrl), new SlideImage(product.ImageUrl4, locationUrl), new SlideImage(product.ImageUrl5, locationUrl) }; this.rptProductImages.DataSource = from item in imageArray where !string.IsNullOrWhiteSpace(item.ImageUrl) select item; this.rptProductImages.DataBind(); } this.litProdcutName.SetWhenIsNotNull(product.ProductName); this.litSoldCount.SetWhenIsNotNull(groupBuy.SoldCount.ToString()); this.litminCount.SetWhenIsNotNull(groupBuy.Count.ToString()); this.litShortDescription.SetWhenIsNotNull(product.ShortDescription); this.litDescription.SetWhenIsNotNull(product.Description); this.litprice.SetWhenIsNotNull(groupBuy.Price.ToString("F2")); TimeSpan span = (TimeSpan)(groupBuy.EndDate - DateTime.Now); this.litLeftSeconds.SetWhenIsNotNull(Math.Ceiling(span.TotalSeconds).ToString()); this.litcontent.SetWhenIsNotNull(groupBuy.Content); this.litGroupBuyId.SetWhenIsNotNull(groupBuy.GroupBuyId.ToString()); this.skuSelector.ProductId = groupBuy.ProductId; this.expandAttr.ProductId = groupBuy.ProductId; this.salePrice.SetWhenIsNotNull(product.MaxSalePrice.ToString("F2")); this.leftCount.SetWhenIsNotNull((groupBuy.MaxCount - groupBuy.SoldCount).ToString()); this.linkDescription.SetWhenIsNotNull("/Vshop/ProductDescription.aspx?productId=" + groupBuy.ProductId); int num = groupBuy.Count - groupBuy.SoldCount; this.minSuccessCount.SetWhenIsNotNull(((num > 0) ? num : 0).ToString()); this.txtProductId.SetWhenIsNotNull(groupBuy.ProductId.ToString()); this.groupBuySoldCount.SetWhenIsNotNull(groupBuy.SoldCount.ToString()); this.litConsultationsCount.SetWhenIsNotNull(ProductBrowser.GetProductConsultationsCount(groupBuy.ProductId, false).ToString()); this.groupBuyMinCount.SetWhenIsNotNull(groupBuy.Count.ToString()); this.litReviewsCount.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(groupBuy.ProductId).ToString()); this.litGroupbuyDescription.SetWhenIsNotNull(groupBuy.Content); this.litMaxCount.SetWhenIsNotNull(groupBuy.MaxCount.ToString()); this.nowTime.SetWhenIsNotNull(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")); this.startTime.SetWhenIsNotNull(groupBuy.StartDate.ToString("yyyy/MM/dd HH:mm:ss")); this.endTime.SetWhenIsNotNull(groupBuy.EndDate.ToString("yyyy/MM/dd HH:mm:ss")); this.groupBuyMaxCount.SetWhenIsNotNull(groupBuy.MaxCount.ToString()); }