示例#1
0
        private void DataBindDiscount()
        {
            this.id = Globals.RequestQueryNum("id");
            if (this.id > 0)
            {
                LimitedTimeDiscountInfo discountInfo = LimitedTimeDiscountHelper.GetDiscountInfo(this.id);
                if (discountInfo != null)
                {
                    this.actionName = discountInfo.ActivityName;
                }
            }
            ProductQuery query = new ProductQuery {
                Keywords    = this.txtProductName.Text,
                ProductCode = "",
                CategoryId  = this.dropCategories.SelectedValue,
                PageSize    = this.pager.PageSize,
                PageIndex   = this.pager.PageIndex,
                SortOrder   = SortAction.Desc
            };

            if (this.dropCategories.SelectedValue.HasValue && (this.dropCategories.SelectedValue > 0))
            {
                query.MaiCategoryPath = CatalogHelper.GetCategory(this.dropCategories.SelectedValue.Value).Path;
            }
            DbQueryResult discountProducted = LimitedTimeDiscountHelper.GetDiscountProducted(query, this.id);

            this.grdProducts.DataSource = discountProducted.Data;
            this.grdProducts.DataBind();
            this.pager.TotalRecords = discountProducted.TotalRecords;
        }
示例#2
0
        private void DataBindDiscount()
        {
            string str = Globals.RequestQueryStr("key").Trim();

            if (!string.IsNullOrEmpty(str))
            {
                this.txtProductName.Text = str;
            }
            int num = Globals.RequestQueryNum("cid");

            this.id = Globals.RequestQueryNum("id");
            int?nullable = null;

            if (num > 0)
            {
                nullable = new int?(num);
                this.dropCategories.SelectedValue = new int?(num);
            }
            if (this.id > 0)
            {
                LimitedTimeDiscountInfo discountInfo = LimitedTimeDiscountHelper.GetDiscountInfo(this.id);
                if (discountInfo != null)
                {
                    this.actionName = discountInfo.ActivityName;
                }
                ProductQuery query = new ProductQuery
                {
                    Keywords    = str,
                    ProductCode = "",
                    CategoryId  = nullable,
                    PageSize    = this.pager.PageSize,
                    PageIndex   = this.pager.PageIndex,
                    SortOrder   = SortAction.Desc
                };
                if (num > 0)
                {
                    query.MaiCategoryPath = CatalogHelper.GetCategory(num).Path;
                }
                DbQueryResult discountProducted = LimitedTimeDiscountHelper.GetDiscountProducted(query, this.id);
                this.grdProducts.DataSource = discountProducted.Data;
                this.grdProducts.DataBind();
                this.pager.TotalRecords = discountProducted.TotalRecords;
            }
            else
            {
                base.Response.Redirect("LimitedTimeDiscountList.aspx");
            }
        }