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  = (Literal)this.FindControl("litContent");
            this.rptProducts = (AppshopTemplatedRepeater)this.FindControl("rptCountDownProducts");
            this.txtTotal    = (HtmlInputHidden)this.FindControl("txtTotal");
            string text     = this.Page.Request["lat"].ToNullString();
            string text2    = this.Page.Request["lng"].ToNullString();
            string cityName = this.Page.Request["city"].ToNullString();
            string address  = this.Page.Request["address"].ToNullString();

            if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2))
            {
                RegionInfo regionByCityAddress = RegionHelper.GetRegionByCityAddress(cityName, address);
                if (regionByCityAddress != null)
                {
                    int num = regionByCityAddress.RegionId;
                    if (regionByCityAddress.FullRegionPath.Split(',').Length >= 2)
                    {
                        num = regionByCityAddress.FullRegionPath.Split(',')[1].ToInt(0);
                    }
                    WebHelper.SetCookie("UserCoordinateCookie", "CityRegionId", num.ToNullString(), null);
                    WebHelper.SetCookie("UserCoordinateCookie", "RegionId", regionByCityAddress.RegionId.ToNullString(), null);
                    WebHelper.SetCookie("UserCoordinateCookie", "FullRegionPath", regionByCityAddress.FullRegionPath, null);
                }
                WebHelper.SetCookie("UserCoordinateCookie", "NewCoordinate", $"{text},{text2}", null);
            }
            this.rptCategories = (AppshopTemplatedRepeater)this.FindControl("rptCategories");
            if (this.rptCategories != null)
            {
                IEnumerable <CategoryInfo> subCategories = CatalogHelper.GetSubCategories(this.categoryId);
                this.rptCategories.DataSource = subCategories;
                this.rptCategories.DataBind();
            }
            int page = default(int);

            if (!int.TryParse(this.Page.Request.QueryString["page"], out page))
            {
                page = 1;
            }
            int size = default(int);

            if (!int.TryParse(this.Page.Request.QueryString["size"], out size))
            {
                size = 10;
            }
            int       storeId = this.Page.Request.QueryString["StoreId"].ToInt(0);
            int       num2    = default(int);
            DataTable countDownProductList = PromoteHelper.GetCountDownProductList(this.categoryId, this.keyWord, page, size, storeId, out num2, false);

            this.rptProducts.ItemDataBound += this.rptProduct_ItemDataBound;
            this.rptProducts.DataSource     = countDownProductList;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(num2.ToString());
            PageTitle.AddSiteNameTitle("限时抢购");
        }
        private void BindProduct()
        {
            ProductBrowseQuery productBrowseQuery   = this.GetProductBrowseQuery();
            DbQueryResult      countDownProductList = PromoteHelper.GetCountDownProductList(productBrowseQuery);

            this.rptProduct.DataSource = countDownProductList.Data;
            this.rptProduct.DataBind();
            this.pager.TotalRecords = countDownProductList.TotalRecords;
        }
Exemple #3
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    = (Literal)this.FindControl("litContent");
            this.rptProducts   = (WapTemplatedRepeater)this.FindControl("rptCountDownProducts");
            this.txtTotal      = (HtmlInputHidden)this.FindControl("txtTotal");
            this.rptCategories = (WapTemplatedRepeater)this.FindControl("rptCategories");
            if (this.rptCategories != null)
            {
                IEnumerable <CategoryInfo> subCategories = CatalogHelper.GetSubCategories(this.categoryId);
                this.rptCategories.DataSource = subCategories;
                this.rptCategories.DataBind();
            }
            int page = default(int);

            if (!int.TryParse(this.Page.Request.QueryString["page"], out page))
            {
                page = 1;
            }
            int size = default(int);

            if (!int.TryParse(this.Page.Request.QueryString["size"], out size))
            {
                size = 10;
            }
            int       storeId = this.Page.Request.QueryString["StoreId"].ToInt(0);
            int       num     = default(int);
            DataTable countDownProductList = PromoteHelper.GetCountDownProductList(this.categoryId, this.keyWord, page, size, storeId, out num, false);

            this.rptProducts.ItemDataBound += this.rptProduct_ItemDataBound;
            this.rptProducts.DataSource     = countDownProductList;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(num.ToString());
            PageTitle.AddSiteNameTitle("限时抢购");
        }