private void BindProducts()
        {
            ProductQuery entity = new ProductQuery();

            entity.Keywords    = productName;
            entity.ProductCode = productCode;
            entity.CategoryId  = categoryId;

            if (categoryId.HasValue)
            {
                entity.MaiCategoryPath = SubsiteCatalogHelper.GetCategory(categoryId.Value).Path;
            }
            entity.PageSize   = pager.PageSize;
            entity.PageIndex  = pager.PageIndex;
            entity.SaleStatus = ProductSaleStatus.UnSale;
            entity.SortOrder  = SortAction.Desc;
            entity.SortBy     = "DisplaySequence";
            Globals.EntityCoding(entity, true);
            DbQueryResult products = SubSiteProducthelper.GetProducts(entity);

            grdProducts.DataSource = products.Data;
            grdProducts.DataBind();
            pager.TotalRecords  = products.TotalRecords;
            pager1.TotalRecords = products.TotalRecords;
        }
Exemplo n.º 2
0
        private void BindProducts()
        {
            ProductQuery query = new ProductQuery();

            query.Keywords = keywords;

            query.CategoryId = categoryId;

            if (categoryId.HasValue)
            {
                query.MaiCategoryPath = SubsiteCatalogHelper.GetCategory(categoryId.Value).Path;
            }

            query.PageSize   = 10;
            query.PageIndex  = pager.PageIndex;
            query.SaleStatus = ProductSaleStatus.OnSale;
            query.SortOrder  = SortAction.Desc;
            query.SortBy     = "DisplaySequence";

            DbQueryResult products = SubSiteProducthelper.GetProducts(query);

            dlstProducts.DataSource = products.Data;
            dlstProducts.DataBind();
            pager.TotalRecords = products.TotalRecords;
        }
Exemplo n.º 3
0
        private void BindProducts()
        {
            ProductQuery productQuery = new ProductQuery();

            productQuery.Keywords    = this.productName;
            productQuery.ProductCode = this.productCode;
            productQuery.CategoryId  = this.categoryId;
            productQuery.TagId       = this.tagId;
            if (this.categoryId.HasValue)
            {
                productQuery.MaiCategoryPath = SubsiteCatalogHelper.GetCategory(this.categoryId.Value).Path;
            }
            productQuery.PageSize   = this.pager.PageSize;
            productQuery.PageIndex  = this.pager.PageIndex;
            productQuery.IsAlert    = this.isAlert;
            productQuery.SaleStatus = this.saleStatus;
            productQuery.SortOrder  = SortAction.Desc;
            productQuery.SortBy     = "DisplaySequence";
            Globals.EntityCoding(productQuery, true);
            DbQueryResult products = SubSiteProducthelper.GetProducts(productQuery);

            this.grdProducts.DataSource = products.Data;
            this.grdProducts.DataBind();
            this.pager.TotalRecords  = products.TotalRecords;
            this.pager1.TotalRecords = products.TotalRecords;
        }
Exemplo n.º 4
0
        protected void DoCallback()
        {
            this.LoadParameters();
            ProductQuery query = new ProductQuery
            {
                PageSize   = this.pager.PageSize,
                PageIndex  = this.pager.PageIndex,
                SaleStatus = ProductSaleStatus.OnSale,
                IsIncludePromotionProduct = false,
                IsIncludeBundlingProduct  = false,
                Keywords = this.txtSearchText.Text
            };

            if (this.brandId.HasValue)
            {
                query.BrandId = new int?(this.brandId.Value);
            }
            query.CategoryId = this.categoryId;
            if (this.categoryId.HasValue)
            {
                query.MaiCategoryPath = SubsiteCatalogHelper.GetCategory(this.categoryId.Value).Path;
            }
            DbQueryResult products = SubSiteProducthelper.GetProducts(query);
            DataTable     data     = (DataTable)products.Data;

            this.pager1.TotalRecords    = this.pager.TotalRecords = products.TotalRecords;
            this.grdproducts.DataSource = data;
            this.grdproducts.DataBind();
        }
Exemplo n.º 5
0
        protected void DoCallback()
        {
            this.Page.Response.Clear();
            base.Response.ContentType = "text/json";
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            int num       = 0;
            int num2      = 0;
            int pageIndex = 1;

            int.TryParse(base.Request.Params["categoryId"], out num);
            int.TryParse(base.Request.Params["brandId"], out num2);
            int.TryParse(base.Request.Params["page"], out pageIndex);
            ProductQuery productQuery = new ProductQuery();

            productQuery.PageSize   = 15;
            productQuery.PageIndex  = pageIndex;
            productQuery.SaleStatus = ProductSaleStatus.OnSale;
            productQuery.IsIncludePromotionProduct = new bool?(false);
            productQuery.IsIncludeBundlingProduct  = new bool?(false);
            productQuery.Keywords = base.Request.Params["serachName"];
            if (num2 != 0)
            {
                productQuery.BrandId = new int?(num2);
            }
            productQuery.CategoryId = new int?(num);
            if (num != 0)
            {
                productQuery.MaiCategoryPath = SubsiteCatalogHelper.GetCategory(num).Path;
            }
            DbQueryResult products = SubSiteProducthelper.GetProducts(productQuery);

            System.Data.DataTable dataTable = (System.Data.DataTable)products.Data;
            stringBuilder.Append("{'data':[");
            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                stringBuilder.Append("{'ProductId':'");
                stringBuilder.Append(dataTable.Rows[i]["ProductId"].ToString().Trim());
                stringBuilder.Append("','Name':'");
                stringBuilder.Append(dataTable.Rows[i]["ProductName"].ToString());
                stringBuilder.Append("','Price':'");
                stringBuilder.Append(((decimal)dataTable.Rows[i]["SalePrice"]).ToString("F2"));
                stringBuilder.Append("','Stock':'");
                stringBuilder.Append(dataTable.Rows[i]["Stock"].ToString());
                stringBuilder.Append("'},");
            }
            stringBuilder.Append("],'recCount':'");
            stringBuilder.Append(products.TotalRecords);
            stringBuilder.Append("'}");
            base.Response.Write(stringBuilder.ToString());
            base.Response.End();
        }
Exemplo n.º 6
0
        private void BindProducts()
        {
            ProductQuery query = new ProductQuery();

            query.Keywords   = txtSearchText.Text;
            query.CategoryId = dropCategories.SelectedValue;
            query.PageSize   = 10;
            query.PageIndex  = pageindex;
            query.SaleStatus = ProductSaleStatus.OnSale;
            query.SortOrder  = SortAction.Desc;
            query.SortBy     = "DisplaySequence";
            DbQueryResult products = SubSiteProducthelper.GetProducts(query);

            dlstProducts.DataSource = products.Data;
            dlstProducts.DataBind();
            pager.TotalRecords = products.TotalRecords;
        }
        protected void DoCallback()
        {
            this.LoadParameters();
            ProductQuery query = new ProductQuery();

            query.PageSize   = this.pager.PageSize;
            query.PageIndex  = this.pager.PageIndex;
            query.SaleStatus = ProductSaleStatus.OnSale;
            query.Keywords   = this.productName;
            query.CategoryId = this.categoryId;
            if (this.categoryId.HasValue)
            {
                query.MaiCategoryPath = SubsiteCatalogHelper.GetCategory(this.categoryId.Value).Path;
            }
            query.IsIncludePromotionProduct = false;
            DbQueryResult products = SubSiteProducthelper.GetProducts(query);
            DataTable     data     = (DataTable)products.Data;

            this.pager1.TotalRecords       = this.pager.TotalRecords = products.TotalRecords;
            this.rp_bindproduct.DataSource = data;
            this.rp_bindproduct.DataBind();
        }