Exemple #1
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("rptCountDownProducts");
            this.txtTotal      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            if (this.rptCategories != null)
            {
                System.Collections.Generic.IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 1000);
                this.rptCategories.DataSource = maxSubCategories;
                this.rptCategories.DataBind();
            }
            int page;

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

            if (!int.TryParse(this.Page.Request.QueryString["size"], out size))
            {
                size = 10;
            }
            int       num;
            DataTable countDownProductList = ProductBrowser.GetCountDownProductList(new int?(this.categoryId), this.keyWord, page, size, out num, true);

            this.rptProducts.DataSource = countDownProductList;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(num.ToString());
            PageTitle.AddSiteNameTitle("限时抢购");
        }
        private void BindProduct()
        {
            DbQueryResult countDownProductList = ProductBrowser.GetCountDownProductList(this.GetProductBrowseQuery());

            this.rptProduct.DataSource = countDownProductList.Data;
            this.rptProduct.DataBind();
            this.pager.TotalRecords = countDownProductList.TotalRecords;
        }
Exemple #3
0
        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
        }
Exemple #4
0
 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();
     }
 }
Exemple #5
0
        private ListResult <SimpleCountDownProductListItem> GetCountDownProduct(int siteId, int pageIndex, int pageSize)
        {
            DataTable dt = ProductBrowser.GetCountDownProductList(pageSize);

            ListResult <SimpleCountDownProductListItem> data = null;

            List <SimpleCountDownProductListItem> items = new List <SimpleCountDownProductListItem>();

            if (dt != null)
            {
                SimpleCountDownProductListItem item = null;

                foreach (DataRow current in dt.Rows)
                {
                    item = new SimpleCountDownProductListItem();

                    //item.SalePrice = 0;
                    //if (current["SalePrice"] != DBNull.Value)
                    //{
                    //    item.SalePrice = (decimal)current["SalePrice"];
                    //}

                    item.MarketPrice = 0;
                    if (current["MarketPrice"] != DBNull.Value)
                    {
                        item.MarketPrice = (decimal)current["MarketPrice"];
                    }

                    item.CountDownPrice = 0;
                    if (current["CountDownPrice"] != DBNull.Value)
                    {
                        item.CountDownPrice = (decimal)current["CountDownPrice"];
                    }

                    item.ImageUrl = "";
                    if (current["ThumbnailUrl220"] != DBNull.Value)
                    {
                        item.ImageUrl = Util.AppendImageHost(((string)current["ThumbnailUrl220"]));
                    }

                    items.Add(item);
                }
            }

            data = new ListResult <SimpleCountDownProductListItem>();
            data.TotalNumOfRecords = items.Count;
            data.Results           = items;

            return(data);
        }
Exemple #6
0
 private void BindList()
 {
     if (this.rpActivity != null)
     {
         ProductBrowseQuery productBrowseQuery = new ProductBrowseQuery();
         productBrowseQuery.IsCount   = true;
         productBrowseQuery.PageIndex = 1;
         productBrowseQuery.PageSize  = 10;
         productBrowseQuery.SortBy    = "DisplaySequence";
         productBrowseQuery.SortOrder = SortAction.Asc;
         DbQueryResult countDownProductList = ProductBrowser.GetCountDownProductList(productBrowseQuery);
         if (countDownProductList != null && countDownProductList.TotalRecords > 0)
         {
             DataTable temp    = countDownProductList.Data as DataTable;
             DataRow[] curtemp = null;
             if (this.times == "20151")
             {
                 curtemp = temp.Select("StartDate = '2015-12-28 10:00:00.000'");
             }
             this.rpActivity.DataSource = curtemp;
             this.rpActivity.DataBind();
         }
     }
 }