public void btnRefer_Click(object sender, EventArgs e) { if (this.ValidateConvert()) { ProductReviewInfo target = new ProductReviewInfo(); target.ReviewDate = DateTime.Now; target.ProductId = this.productId; target.UserId = HiContext.Current.User.UserId; target.UserName = this.txtUserName.Text; target.UserEmail = this.txtEmail.Text; target.ReviewText = this.txtContent.Text; ValidationResults results = Hishop.Components.Validation.Validation.Validate <ProductReviewInfo>(target, new string[] { "Refer" }); string msg = string.Empty; if (!results.IsValid) { foreach (ValidationResult result in (IEnumerable <ValidationResult>)results) { msg = msg + Formatter.FormatErrorMessage(result.Message); } this.ShowMessage(msg, false); } else if (((HiContext.Current.User.UserRole == UserRole.Member) || (HiContext.Current.User.UserRole == UserRole.Underling)) || this.userRegion(this.txtReviewUserName.Value, this.txtReviewPsw.Value)) { if (string.IsNullOrEmpty(this.txtReviewCode.Value)) { this.ShowMessage("请输入验证码", false); } else if (!HiContext.Current.CheckVerifyCode(this.txtReviewCode.Value.Trim())) { this.ShowMessage("验证码不正确", false); } else { int buyNum = 0; int reviewNum = 0; ProductBrowser.LoadProductReview(this.productId, out buyNum, out reviewNum); if (buyNum == 0) { this.ShowMessage("您没有购买此商品,因此不能进行评论", false); } else if (reviewNum >= buyNum) { this.ShowMessage("您已经对此商品进行了评论,请再次购买后方能再进行评论", false); } else if (ProductProcessor.InsertProductReview(target)) { this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "success", string.Format("<script>alert(\"{0}\");window.location.href=\"{1}\"</script>", "评论成功", Globals.GetSiteUrls().UrlData.FormatUrl("productReviews", new object[] { this.productId }))); } else { this.ShowMessage("评论失败,请重试", false); } } } } }
protected override void AttachChildControls() { this.vcountdownproducts = (VshopTemplatedRepeater)this.FindControl("vcountdownproducts"); this.txtTotal = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal"); this.litItemParams = (Literal)this.FindControl("litItemParams"); if (!int.TryParse(this.Page.Request.QueryString["page"], out num)) { num = 1; } if (!int.TryParse(this.Page.Request.QueryString["size"], out num2)) { num2 = 10; } ProductBrowseQuery query = new ProductBrowseQuery { PageIndex = num, PageSize = num2, SortBy = "CountDownId", SortOrder = SortAction.Desc, }; DbQueryResult drSource = ProductBrowser.GetCountDownProductList(query); num3 = drSource.TotalRecords; txtTotal.SetWhenIsNotNull(num3.ToString()); this.vcountdownproducts.DataSource = drSource.Data; this.vcountdownproducts.DataBind(); #region 微信分享内容配置 SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); DistributorsInfo userIdDistributors = new DistributorsInfo(); userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId); if ((userIdDistributors != null) && (userIdDistributors.UserId > 0)) { PageTitle.AddSiteNameTitle(userIdDistributors.StoreName); } string str3 = ""; if (!string.IsNullOrEmpty(masterSettings.ShopHomePic)) { str3 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic; } string str4 = ""; string str5 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName; if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic)) { str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0]; } string strDes = masterSettings.ShopHomeDescription; if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.BrandShow) { strDes = "低价抢正品,马上有优惠,就在考拉萌购!"; } this.litItemParams.Text = str3 + "|" + masterSettings.ShopHomeName + "|" + strDes + "$"; this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str4, "|好店推荐之", str5, "商城|" + strDes + "|", HttpContext.Current.Request.Url }); #endregion }
private void BindProduct() { ProductBrowseQuery productBrowseQuery = this.GetProductBrowseQuery(); int totalRecords; DataSet groupByProductList = ProductBrowser.GetGroupByProductList(productBrowseQuery, out totalRecords); this.rptProduct.DataSource = groupByProductList; this.rptProduct.DataBind(); this.pager.TotalRecords = totalRecords; }
protected void btnDeleteSelect_Click(object sender, EventArgs e) { string ids = this.Page.Request["CheckboxGroup"]; if (!ProductBrowser.DeleteFavorites(ids)) { this.ShowMessage("删除失败", false, "", 1); } this.ReloadFavorites(); }
private DataTable GetProductList(XmlNode node) { SubjectListQuery query = new SubjectListQuery(); query.SortBy = "DisplaySequence"; query.SortOrder = SortAction.Desc; query.CategoryIds = node.Attributes["CategoryId"].Value; query.MaxNum = int.Parse(node.Attributes["MaxNum"].Value); return(ProductBrowser.GetSubjectList(query)); }
private void BindGuestProducts() { IList <AppProductYouLikeModel> newProductYouLikeModel = ProductBrowser.GetNewProductYouLikeModel(this.productId, 0, 0, null, false); if (newProductYouLikeModel != null && newProductYouLikeModel.Count > 0) { this.rp_guest.DataSource = newProductYouLikeModel; this.rp_guest.DataBind(); } }
private DataTable GetProductList(XmlNode node) { return(ProductBrowser.GetSubjectList(new SubjectListQuery { SortBy = "DisplaySequence", SortOrder = SortAction.Desc, CategoryIds = node.Attributes["CategoryId"].Value, MaxNum = int.Parse(node.Attributes["MaxNum"].Value) })); }
private void DataBindSoruce() { int num; this.txtkeywords.Value = this.keyWord; this.rpCategorys.DataSource = CategoryBrowser.GetCategories(wid); this.rpCategorys.DataBind(); this.rpChooseProducts.DataSource = ProductBrowser.GetProducts(MemberProcessor.GetCurrentMember(), null, new int?(this.categoryId), this.keyWord, 1, 10, out num, "DisplaySequence", "desc", true); this.rpChooseProducts.DataBind(); }
private void RenderSaleTop(XmlNode node, StringBuilder sb) { DataTable saleProductRanking = ProductBrowser.GetSaleProductRanking(new int?(this.categoryId), int.Parse(node.Attributes["SaleTopNum"].Value)); if ((saleProductRanking != null) && (saleProductRanking.Rows.Count > 0)) { int result = 0; int.TryParse(node.Attributes["ImageNum"].Value, out result); bool flag = false; bool.TryParse(node.Attributes["IsShowPrice"].Value, out flag); bool flag2 = false; bool.TryParse(node.Attributes["IsShowSaleCounts"].Value, out flag2); bool flag3 = false; bool.TryParse(node.Attributes["IsImgShowPrice"].Value, out flag3); bool flag4 = false; bool.TryParse(node.Attributes["IsImgShowSaleCounts"].Value, out flag4); sb.AppendLine("<div class=\"bd_saletop\">"); sb.AppendLine("<ul>"); int num2 = 0; SiteSettings siteSettings = HiContext.Current.SiteSettings; foreach (DataRow row in saleProductRanking.Rows) { string defaultProductImage = siteSettings.DefaultProductImage; if (row["ThumbnailUrl" + node.Attributes["TopImageSize"].Value] != DBNull.Value) { defaultProductImage = row["ThumbnailUrl" + node.Attributes["TopImageSize"].Value].ToString(); } num2++; sb.AppendFormat("<li class=\"sale_top{0}\">", num2).AppendLine(); if (num2 <= result) { sb.AppendFormat("<div class=\"pic\"><a target=\"_blank\" href=\"{0}\"><img src=\"{1}\" /></a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[] { row["ProductId"] }), Globals.ApplicationPath + defaultProductImage).AppendLine(); } sb.AppendLine("<div class=\"info\">"); sb.AppendFormat("<div class=\"name\"><a target=\"_blank\" href=\"{0}\">{1}</a></div>", Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[] { row["ProductId"] }), row["ProductName"]).AppendLine(); if ((flag && (num2 > result)) || (flag3 && (num2 <= result))) { string str2 = string.Empty; if (row["MarketPrice"] != DBNull.Value) { str2 = Globals.FormatMoney((decimal)row["MarketPrice"]); } sb.AppendFormat("<div class=\"price\"><b>{0}</b><span>{1}</span></div>", Globals.FormatMoney((decimal)row["SalePrice"]), str2).AppendLine(); } if ((flag2 && (num2 > result)) || (flag4 && (num2 <= result))) { sb.AppendFormat("<div class=\"sale\">已售出<b>{0}</b>件 </div>", row["SaleCounts"]).AppendLine(); } sb.Append("</div>"); sb.AppendLine("</li>"); } sb.AppendLine("</ul>"); sb.AppendLine("</div>"); } }
protected override void AttachChildControls() { this.litBrandName = (System.Web.UI.WebControls.Literal) this.FindControl("litBrandName"); this.litBrandRemark = (System.Web.UI.WebControls.Literal) this.FindControl("litBrandRemark"); this.rptProducts = (ThemedTemplatedRepeater)this.FindControl("rptProducts"); this.pager = (Pager)this.FindControl("pager"); this.cutdownSearch = (Common_CutdownSearch)this.FindControl("search_Common_CutdownSearch"); this.btnSortPrice = (Common_Search_SortPrice)this.FindControl("btn_Common_Search_SortPrice"); this.btnSortTime = (Common_Search_SortTime)this.FindControl("btn_Common_Search_SortTime"); this.btnSortPopularity = (Common_Search_SortPopularity)this.FindControl("btn_Common_Search_SortPopularity"); this.btnSortSaleCounts = (Common_Search_SortSaleCounts)this.FindControl("btn_Common_Search_SortSaleCounts"); this.cutdownSearch.ReSearch += new Common_CutdownSearch.ReSearchEventHandler(this.cutdownSearch_ReSearch); this.btnSortPrice.Sorting += new Common_Search_SortTime.SortingHandler(this.btnSortPrice_Sorting); this.btnSortTime.Sorting += new Common_Search_SortTime.SortingHandler(this.btnSortTime_Sorting); this.hotSale = (Common_GoodsList_HotSale)this.FindControl("list_Common_GoodsList_HotSale");//销售排行 this.litSearchResultPage = (System.Web.UI.WebControls.Literal) this.FindControl("litSearchResultPage"); if (this.btnSortPopularity != null) { this.btnSortPopularity.Sorting += new Common_Search_SortPopularity.SortingHandler(this.btnSortPopularity_Sorting); } if (this.btnSortSaleCounts != null) { this.btnSortSaleCounts.Sorting += new Common_Search_SortSaleCounts.SortingHandler(this.btnSortSaleCounts_Sorting); } if (this.hotSale != null) { int cid = 0; int brandId = 0; if (!string.IsNullOrEmpty(this.Page.Request.QueryString["categoryId"])) { int.TryParse(this.Page.Request.QueryString["categoryId"], out cid); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["brand"])) { int.TryParse(this.Page.Request.QueryString["brand"], out brandId); } this.hotSale.DataSource = ProductBrowser.GetBrowseHotProductList(cid, brandId).DBHotSale; this.hotSale.DataBind(); } if (!this.Page.IsPostBack) { BrandCategoryInfo brandCategory = CategoryBrowser.GetBrandCategory(this.brandId); if (brandCategory == null) { this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该品牌已经不存在")); return; } this.LoadCategoryHead(brandCategory); this.litBrandName.Text = brandCategory.BrandName; this.litBrandRemark.Text = brandCategory.Description; PageTitle.AddSiteNameTitle(brandCategory.BrandName); this.BindBrandProduct(); } }
private void BindShoppingCart() { ShoppingCartInfo shoppingCart = ShoppingCartProcessor.GetShoppingCart(); if (shoppingCart == null) { this.pnlShopCart.Visible = false; this.litNoProduct.Visible = true; ShoppingCartProcessor.ClearShoppingCart(); } else { this.pnlShopCart.Visible = true; this.litNoProduct.Visible = false; if (shoppingCart.LineItems.Values.Count > 0) { this.shoppingCartProductList.DataSource = shoppingCart.LineItems.Values; this.shoppingCartProductList.DataBind(); this.shoppingCartProductList.ShowProductCart(); } if (shoppingCart.LineGifts.Count > 0) { IEnumerable <ShoppingCartGiftInfo> source = shoppingCart.LineGifts.Where <ShoppingCartGiftInfo>(delegate(ShoppingCartGiftInfo s) { return(s.PromoType == 0); }); IEnumerable <ShoppingCartGiftInfo> enumerable2 = shoppingCart.LineGifts.Where <ShoppingCartGiftInfo>(delegate(ShoppingCartGiftInfo s) { return(s.PromoType == 5); }); this.shoppingCartGiftList.DataSource = source; this.shoppingCartGiftList.FreeDataSource = enumerable2; this.shoppingCartGiftList.DataBind(); this.shoppingCartGiftList.ShowGiftCart(source.Count <ShoppingCartGiftInfo>() > 0, enumerable2.Count <ShoppingCartGiftInfo>() > 0); } if (shoppingCart.IsSendGift) { int sumnum = 1; int giftItemQuantity = ShoppingCartProcessor.GetGiftItemQuantity(PromoteType.SentGift); IList <GiftInfo> onlinePromotionGifts = ProductBrowser.GetOnlinePromotionGifts(); if ((onlinePromotionGifts != null) && (onlinePromotionGifts.Count > 0)) { this.shoppingCartPromoGiftList.DataSource = onlinePromotionGifts; this.shoppingCartPromoGiftList.DataBind(); this.shoppingCartPromoGiftList.ShowPromoGift(sumnum - giftItemQuantity, sumnum); } } if (shoppingCart.IsReduced) { this.lblAmoutPrice.Text = string.Format("商品金额:{0}", shoppingCart.GetAmount().ToString("F2")); this.hlkReducedPromotion.Text = shoppingCart.ReducedPromotionName + string.Format(" 优惠:{0}", shoppingCart.ReducedPromotionAmount.ToString("F2")); this.hlkReducedPromotion.NavigateUrl = Globals.GetSiteUrls().UrlData.FormatUrl("FavourableDetails", new object[] { shoppingCart.ReducedPromotionId }); } this.lblTotalPrice.Money = shoppingCart.GetTotal(); } }
private void BindGift() { GiftQuery giftQuery = new GiftQuery(); giftQuery.Page.PageIndex = this.pager.PageIndex; giftQuery.Page.PageSize = this.pager.PageSize; DbQueryResult onlineGifts = ProductBrowser.GetOnlineGifts(giftQuery); this.rptGifts.DataSource = onlineGifts.Data; this.rptGifts.DataBind(); this.pager.TotalRecords = onlineGifts.TotalRecords; }
private void DataBindSoruce() { //type:0正常显示店铺已上架的商品,1正常显示店铺未上架的商品,2显示所有出售状态的商品,3根据上架范围显示已上架的商品,4根据上架范围显示未上架的商品 ProductInfo.ProductRanage productRanage = DistributorsBrower.GetCurrStoreProductRange(); int num; this.txtkeywords.Value = this.keyWord; this.rpCategorys.DataSource = CategoryBrowser.GetCategories(); this.rpCategorys.DataBind(); this.rpChooseProducts.DataSource = ProductBrowser.GetProductsEx(MemberProcessor.GetCurrentMember(), null, new int?(this.categoryId), this.keyWord, 1, 0x2710, out num, "DisplaySequence", "desc", productRanage); this.rpChooseProducts.DataBind(); }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["giftId"], out this.giftId)) { base.GotoResourceNotFound(); } this.litGiftTite = (Literal)this.FindControl("litGiftTite"); this.litGiftName = (Literal)this.FindControl("litGiftName"); this.lblMarkerPrice = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice"); this.litNeedPoint = (Label)this.FindControl("litNeedPoint"); this.litCurrentPoint = (Label)this.FindControl("litCurrentPoint"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litDescription = (Literal)this.FindControl("litDescription"); this.imgGiftImage = (HiImage)this.FindControl("imgGiftImage"); this.btnChage = (Button)this.FindControl("btnChage"); this.btnChage.Click += new EventHandler(this.btnChage_Click); GiftInfo gift = ProductBrowser.GetGift(this.giftId); if (gift == null) { this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件礼品已经不再参与积分兑换;或被管理员删除")); } else { if (!this.Page.IsPostBack) { this.litGiftName.Text = gift.Name; this.lblMarkerPrice.Money = gift.MarketPrice; this.litNeedPoint.Text = gift.NeedPoint.ToString(); this.litShortDescription.Text = gift.ShortDescription; this.litDescription.Text = gift.LongDescription; this.imgGiftImage.ImageUrl = gift.ThumbnailUrl310; this.LoadPageSearch(gift); } if (((HiContext.Current.User.UserRole == UserRole.Member) || (HiContext.Current.User.UserRole == UserRole.Underling)) && (gift.NeedPoint > 0)) { this.btnChage.Enabled = true; this.btnChage.Text = "立即兑换"; this.litCurrentPoint.Text = ((Member)HiContext.Current.User).Points.ToString(); } else if (gift.NeedPoint <= 0) { this.btnChage.Enabled = false; this.btnChage.Text = "礼品不允许兑换"; } else { this.btnChage.Enabled = false; this.btnChage.Text = "请登录方能兑换"; this.litCurrentPoint.Text = string.Format("<a href=\"{0}\">请登录</a>", Globals.ApplicationPath + "/Login.aspx"); } } }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { base.GotoResourceNotFound(""); } this.litDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription"); ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId); this.litDescription.Text = product.Description; PageTitle.AddSiteNameTitle("商品描述"); }
private void BindGift() { Pagination page = new Pagination(); page.PageIndex = this.pager.PageIndex; page.PageSize = this.pager.PageSize; DbQueryResult onlineGifts = ProductBrowser.GetOnlineGifts(page); this.rptGifts.DataSource = onlineGifts.Data; this.rptGifts.DataBind(); this.pager.TotalRecords = onlineGifts.TotalRecords; }
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.pIds = this.Page.Request.QueryString["pIds"]; if (!string.IsNullOrWhiteSpace(this.keyWord)) { this.keyWord = this.keyWord.Trim(); } this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.litContent = (Literal)this.FindControl("litContent"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories"); this.rptCategoryList = (VshopTemplatedRepeater)this.FindControl("rptCategoryList"); this.txtTotalPages = (HtmlInputHidden)this.FindControl("txtTotal"); string str = this.Page.Request.QueryString["sort"]; if (string.IsNullOrWhiteSpace(str)) { str = "DisplaySequence"; } string str2 = this.Page.Request.QueryString["order"]; if (string.IsNullOrWhiteSpace(str2)) { str2 = "desc"; } if (!int.TryParse(this.Page.Request.QueryString["page"], out num)) { num = 1; } if (!int.TryParse(this.Page.Request.QueryString["size"], out num2)) { num2 = 20; } IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, wid, 0x3e8); this.rptCategories.DataSource = maxSubCategories; this.rptCategories.DataBind(); DataSet categoryList = CategoryBrowser.GetCategoryList(wid); this.rptCategoryList.ItemDataBound += new RepeaterItemEventHandler(this.rptCategoryList_ItemDataBound); this.rptCategoryList.DataSource = categoryList; this.rptCategoryList.DataBind(); this.rptProducts.DataSource = ProductBrowser.GetProducts(this.wid, MemberProcessor.GetCurrentMember(), null, new int?(this.categoryId), this.keyWord, num, num2, out num3, str, str2, this.pIds); this.rptProducts.DataBind(); this.txtTotalPages.SetWhenIsNotNull(num3.ToString()); PageTitle.AddSiteNameTitle("商品列表"); }
protected override void AttachChildControls() { string url = this.Page.Request.QueryString["returnUrl"]; if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["returnUrl"])) { this.Page.Response.Redirect(url); } Member member = HiContext.Current.User as Member; if (member == null) { this.Page.Response.Redirect("/Vshop/Login.aspx"); } this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.litProFavCount = (System.Web.UI.WebControls.Literal) this.FindControl("litProFavCount"); this.litSuppFavCount = (System.Web.UI.WebControls.Literal) this.FindControl("litSuppFavCount"); this.txtTotal = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal"); int pageIndex; if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex)) { pageIndex = 1; } int pageSize; if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize)) { pageSize = 8; } // ProductFavoriteQuery query = new ProductFavoriteQuery(); query.PageIndex = pageIndex; query.PageSize = pageSize; query.UserId = member.UserId; query.GradeId = member.GradeId; DbQueryResult dr = ProductBrowser.GetFavorites(query); this.rptProducts.DataSource = dr.Data; this.rptProducts.DataBind(); this.litProFavCount.Text = dr.TotalRecords.ToString(); this.litSuppFavCount.Text = SupplierHelper.GetUserSupplierCollectCount(member.UserId).ToString(); this.txtTotal.SetWhenIsNotNull(dr.TotalRecords.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()); }
private void getCategories(System.Web.HttpContext context) { DataTable dtCategory = CategoryBrowser.GetAllCategories(); int categoryCount = ProductBrowser.GetDataCount(" Hishop_Categories ", ""); //输出JSON string result = string.Format("{{\"state\":{0},\r\"count\":{1},\r\"data\":" , (dtCategory.Rows.Count > 0) ? 0 : 1, categoryCount); result += JsonConvert.SerializeObject(dtCategory, Newtonsoft.Json.Formatting.Indented); result += "}"; context.Response.Write(result); }
private void BindData() { Pagination page = new Pagination(); page.PageIndex = this.pager.PageIndex; page.PageSize = this.pager.PageSize; DbQueryResult productReviews = ProductBrowser.GetProductReviews(page, this.productId); this.rptRecords.DataSource = productReviews.Data; this.rptRecords.DataBind(); this.pager.TotalRecords = productReviews.TotalRecords; }
private void DataBindSoruce() { this.txtkeywords.Value = this.keyWord; this.rpCategorys.DataSource = CategoryBrowser.GetCategories(); this.rpCategorys.DataBind(); int num; this.rpChooseProducts.DataSource = ProductBrowser.GetProducts(MemberProcessor.GetCurrentMember(), null, new int?(this.categoryId), this.keyWord, 1, 20, out num, "DisplaySequence", "desc", true); this.rpChooseProducts.DataBind(); this.litProtuctSelNum.Text = "(" + ProductBrowser.GetProductsNumber(true).ToString() + ")"; this.litProtuctNoSelNum.Text = "(" + ProductBrowser.GetProductsNumber(false).ToString() + ")"; }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { base.GotoResourceNotFound(""); } ProductConsultationAndReplyQuery productConsultationAndReplyQuery = new ProductConsultationAndReplyQuery(); int pageIndex = default(int); if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex)) { pageIndex = 1; } int pageSize = default(int); if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize)) { pageSize = 20; } productConsultationAndReplyQuery.ProductId = this.productId; productConsultationAndReplyQuery.IsCount = true; productConsultationAndReplyQuery.PageIndex = pageIndex; productConsultationAndReplyQuery.PageSize = pageSize; productConsultationAndReplyQuery.SortBy = "ConsultationId"; productConsultationAndReplyQuery.SortOrder = SortAction.Desc; productConsultationAndReplyQuery.HasReplied = true; this.rptProducts = (WapTemplatedRepeater)this.FindControl("rptProducts"); this.txtTotal = (HtmlInputHidden)this.FindControl("txtTotal"); DbQueryResult productConsultations = ProductBrowser.GetProductConsultations(productConsultationAndReplyQuery); this.rptProducts.DataSource = productConsultations.Data; this.rptProducts.DataBind(); HtmlInputHidden control = this.txtTotal; int num = productConsultations.TotalRecords; control.SetWhenIsNotNull(num.ToString()); this.litProductTitle = (Literal)this.FindControl("litProductTitle"); this.litShortDescription = (Literal)this.FindControl("litShortDescription"); this.litSoldCount = (Literal)this.FindControl("litSoldCount"); this.litSalePrice = (Literal)this.FindControl("litSalePrice"); this.imgProductImage = (HtmlImage)this.FindControl("imgProductImage"); ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId); this.litProductTitle.SetWhenIsNotNull(productSimpleInfo.ProductName); this.litShortDescription.SetWhenIsNotNull(productSimpleInfo.ShortDescription); Literal control2 = this.litSoldCount; num = productSimpleInfo.ShowSaleCounts; control2.SetWhenIsNotNull(num.ToString()); this.litSalePrice.SetWhenIsNotNull(productSimpleInfo.MinSalePrice.F2ToString("f2")); this.imgProductImage.Src = (string.IsNullOrEmpty(productSimpleInfo.ThumbnailUrl60) ? Globals.FullPath(this.siteSettings.DefaultProductThumbnail4) : productSimpleInfo.ThumbnailUrl60); PageTitle.AddSiteNameTitle("商品咨询"); }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["productID"], out this.productId)) { base.GotoResourceNotFound(); } this.lblProductNameLinkText = (System.Web.UI.WebControls.Label) this.FindControl("lblProductNameLinkText"); this.hlinkProductTitle = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkProductTitle"); this.hlinkProductContent = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkProductContent"); this.lblImgUrl = (System.Web.UI.WebControls.Label) this.FindControl("lblImgUrl"); this.lblUrl = (System.Web.UI.WebControls.Label) this.FindControl("lblUrl"); this.lblUrl2 = (System.Web.UI.WebControls.Label) this.FindControl("lblUrl2"); this.imgUrl = (HiImage)this.FindControl("imgUrl"); if (!this.Page.IsPostBack) { ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId); if (productSimpleInfo == null) { base.GotoResourceNotFound(); } PageTitle.AddSiteNameTitle(productSimpleInfo.ProductName + " 推荐到博客", Hidistro.Membership.Context.HiContext.Current.Context); string text = "productDetails"; if (productSimpleInfo.SaleStatus == ProductSaleStatus.UnSale) { text = "unproductdetails"; } string text2 = Globals.GetSiteUrls().UrlData.FormatUrl(text, new object[] { this.productId }); this.hlinkProductTitle.Text = (this.hlinkProductContent.Text = productSimpleInfo.ProductName); this.hlinkProductTitle.NavigateUrl = (this.hlinkProductContent.NavigateUrl = text2); this.lblProductNameLinkText.Text = string.Format("插入这段代码,可以在你的博客中显示“{0}”的文字链接", string.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", text2, "Text")); this.imgUrl.ImageUrl = productSimpleInfo.ImageUrl1; if (!string.IsNullOrEmpty(productSimpleInfo.ImageUrl1)) { this.lblImgUrl.Text = Globals.FullPath(Globals.ApplicationPath + this.imgUrl.ImageUrl); } Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.HiContext.Current.User; if (user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member || user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Underling) { this.lblUrl.Text = (this.lblUrl2.Text = Globals.FullPath(System.Web.HttpContext.Current.Request.Url.PathAndQuery).Replace("BlogIt", text) + "&ReferralUserId=" + user.UserId); } else { this.lblUrl.Text = (this.lblUrl2.Text = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl(text, new object[] { this.productId }))); } } }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { base.GotoResourceNotFound(); } this.hlinkProductOfTitle = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkProductOfTitle"); this.hlinkProductOfContext = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkProductOfContext"); this.hlinkHome = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkHome"); this.litProductUrl = (System.Web.UI.WebControls.Literal) this.FindControl("litProductUrl"); this.txtFriendEmail = (System.Web.UI.WebControls.TextBox) this.FindControl("txtFriendEmail"); this.txtFriendName = (System.Web.UI.WebControls.TextBox) this.FindControl("txtFriendName"); this.txtUserName = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName"); this.txtMessage = (System.Web.UI.WebControls.TextBox) this.FindControl("txtMessage"); this.btnRefer = (System.Web.UI.WebControls.Button) this.FindControl("btnRefer"); this.txtTJCode = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtTJCode"); this.btnRefer.Click += new System.EventHandler(this.btnRefer_Click); if (!this.Page.IsPostBack) { ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId); if (productSimpleInfo != null) { Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.HiContext.Current.User; this.txtUserName.Text = user.Username; this.hlinkProductOfTitle.Text = productSimpleInfo.ProductName; this.hlinkProductOfTitle.NavigateUrl = Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[] { this.productId }); this.hlinkProductOfContext.Text = productSimpleInfo.ProductName; this.hlinkProductOfContext.NavigateUrl = Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[] { this.productId }); this.hlinkHome.NavigateUrl = Globals.GetSiteUrls().UrlData.FormatUrl("home"); this.hlinkHome.Text = Hidistro.Membership.Context.HiContext.Current.SiteSettings.SiteName; this.txtTJCode.Value = string.Empty; if (user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member || user.UserRole == Hidistro.Membership.Core.Enums.UserRole.Underling) { this.litProductUrl.Text = Globals.FullPath(System.Web.HttpContext.Current.Request.Url.PathAndQuery).Replace("IntroducedToFriend", "productDetails") + "&ReferralUserId=" + user.UserId; } else { this.litProductUrl.Text = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("productDetails", new object[] { this.productId })); } PageTitle.AddSiteNameTitle(productSimpleInfo.ProductName + " 推荐给好友", Hidistro.Membership.Context.HiContext.Current.Context); } } }
private void BindPtAndReviewsAndReplys() { UserProductReviewAndReplyQuery userProductReviewAndReplyQuery = new UserProductReviewAndReplyQuery(); userProductReviewAndReplyQuery.PageIndex = this.pager.PageIndex; userProductReviewAndReplyQuery.PageSize = this.pager.PageSize; int totalRecords = 0; DataSet userProductReviewsAndReplys = ProductBrowser.GetUserProductReviewsAndReplys(userProductReviewAndReplyQuery, out totalRecords); this.dlstPts.DataSource = userProductReviewsAndReplys.Tables[0].DefaultView; this.dlstPts.DataBind(); this.pager.TotalRecords = totalRecords; }
protected override void AttachChildControls() { string url = this.Page.Request.QueryString["returnUrl"]; if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["returnUrl"])) { this.Page.Response.Redirect(url); } this.rptProducts = (AliOHTemplatedRepeater)this.FindControl("rptProducts"); this.rptProducts.DataSource = ProductBrowser.GetFavorites(); this.rptProducts.DataBind(); PageTitle.AddSiteNameTitle("我的收藏"); }
private void BindList() { if (this.rptProduct != null) { //DataTable table = ProductBrowser.GetLimitProducts(20, 1, 20); //this.rptProduct.DataSource = table; //this.rptProduct.DataBind(); ProductBrowseQuery productBrowseQuery = this.GetProductBrowseQuery(); DbQueryResult countDownProductList = ProductBrowser.GetCountDownProductList(productBrowseQuery); this.rptProduct.DataSource = countDownProductList.Data; this.rptProduct.DataBind(); } }
private void BindBrandProduct() { ProductBrowseQuery productBrowseQuery = this.GetProductBrowseQuery(); DbQueryResult browseProductList = ProductBrowser.GetBrowseProductList(productBrowseQuery); this.rptProduct.DataSource = browseProductList.Data; this.rptProduct.DataBind(); this.pager.TotalRecords = browseProductList.TotalRecords; int num = 0; num = ((!(Convert.ToDouble(browseProductList.TotalRecords) % (double)this.pager.PageSize > 0.0)) ? (browseProductList.TotalRecords / this.pager.PageSize) : (browseProductList.TotalRecords / this.pager.PageSize + 1)); this.litBrandProductResult.Text = $"总共有{browseProductList.TotalRecords}件商品,{this.pager.PageSize}件商品为一页,共{num}页第 {this.pager.PageIndex}页"; }
public decimal DiscountMoney(IList <ShoppingCartItemInfo> infoList) { decimal num = 0M; decimal num2 = 0M; decimal num3 = 0M; DataTable type = ProductBrowser.GetType(); for (int i = 0; i < type.Rows.Count; i++) { decimal num5 = 0M; foreach (ShoppingCartItemInfo info in infoList) { if (!string.IsNullOrEmpty(info.MainCategoryPath) && ((int.Parse(type.Rows[i]["ActivitiesType"].ToString()) == int.Parse(info.MainCategoryPath.Split(new char[] { '|' })[0].ToString())) || (int.Parse(type.Rows[i]["ActivitiesType"].ToString()) == 0))) { num5 += info.SubTotal; } } if (num5 != 0M) { DataTable allFull = ProductBrowser.GetAllFull(int.Parse(type.Rows[i]["ActivitiesType"].ToString())); if (allFull.Rows.Count > 0) { for (int j = 0; j < allFull.Rows.Count; j++) { if (num5 >= decimal.Parse(allFull.Rows[allFull.Rows.Count - 1]["MeetMoney"].ToString())) { num2 = decimal.Parse(allFull.Rows[allFull.Rows.Count - 1]["MeetMoney"].ToString()); num = decimal.Parse(allFull.Rows[allFull.Rows.Count - 1]["ReductionMoney"].ToString()); break; } if (num5 <= decimal.Parse(allFull.Rows[0]["MeetMoney"].ToString())) { num2 = decimal.Parse(allFull.Rows[0]["MeetMoney"].ToString()); num += decimal.Parse(allFull.Rows[0]["ReductionMoney"].ToString()); break; } if (num5 >= decimal.Parse(allFull.Rows[j]["MeetMoney"].ToString())) { num2 = decimal.Parse(allFull.Rows[j]["MeetMoney"].ToString()); num = decimal.Parse(allFull.Rows[j]["ReductionMoney"].ToString()); } } if (num5 >= num2) { num3 += num; } } } } return(num3); }