private void BindProducts() { this.LoadParameters(); //得到当前登录用户所在区域 ManagerInfo currentManager = ManagerHelper.GetCurrentManager();//当前登录用户信息 ////得到商品区域关系表结构 //string strSkuIds = string.Empty; //DataTable dtAgentProduct = DataBaseHelper.GetDataTable("Erp_AgentProduct", string.Format("UserId = '{0}'", currentManager.UserId), null); //foreach(DataRow dr in dtAgentProduct.Rows) //{ // strSkuIds += "'" + dr["SkuId"].ToString() + "',"; //} //strSkuIds = strSkuIds.TrimEnd(','); //string strWhere = string.IsNullOrEmpty(strSkuIds) ? "1=2" : "SkuId in (" + strSkuIds + ")"; string strWhere = string.Format(@"UserId = {0}", currentManager.UserId); DataTable dtProduct = ManagerHelper.GetAgentProduct(strWhere); if (dtProduct.Rows.Count == 0) { this.litTitle.Text = "当前用户无订货商品"; this.litTitle.Visible = true; } this.grdProducts.DataSource = dtProduct; this.grdProducts.DataBind(); //ProductQuery entity = new ProductQuery //{ // Keywords = this.productName, // ProductCode = this.productCode, // CategoryId = this.categoryId, // PageSize = this.pager.PageSize, // PageIndex = this.pager.PageIndex, // SortOrder = SortAction.Desc, // SortBy = "DisplaySequence", // StartDate = this.startDate, // BrandId = this.dropBrandList.SelectedValue.HasValue ? this.dropBrandList.SelectedValue : null, // TagId = this.dropTagList.SelectedValue.HasValue ? this.dropTagList.SelectedValue : null, // TypeId = this.typeId, // SaleStatus = this.saleStatus, // EndDate = this.endDate, // SkuIds = strSkuIds //}; //if (this.categoryId.HasValue && this.categoryId > 0) //{ // entity.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; //} //Globals.EntityCoding(entity, true); //DbQueryResult products = ProductHelper.GetProductsByAgent(entity); //this.grdProducts.DataSource = products.Data; //this.grdProducts.DataBind(); //this.txtSearchText.Text = entity.Keywords; //this.txtSKU.Text = entity.ProductCode; //this.dropCategories.SelectedValue = entity.CategoryId; //this.dropType.SelectedValue = entity.TypeId; //this.pager1.TotalRecords = (this.pager.TotalRecords = products.TotalRecords); }