public List<ProductDetail> GetFilterProducts(string categoryid, List<FilterAttr> Attrs, int doctype, string beginprice, string endprice, int ispublic, string keyWords, string orderby, bool isasc, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID) { var dal = new ProductsDAL(); StringBuilder attrbuild = new StringBuilder(); StringBuilder salebuild = new StringBuilder(); foreach (var attr in Attrs) { if (attr.Type == EnumAttrType.Parameter) { attrbuild.Append(" and p.ValueList like '%" + attr.ValueID + "%'"); } else if (attr.Type == EnumAttrType.Specification) { salebuild.Append(" and AttrValue like '%" + attr.ValueID + "%'"); } } DataSet ds = dal.GetFilterProducts(categoryid, attrbuild.ToString(), salebuild.ToString(), doctype, beginprice, endprice, ispublic, keyWords, orderby, isasc ? 1 : 0, pageSize, pageIndex, ref totalCount, ref pageCount, clientID); List<ProductDetail> list = new List<ProductDetail>(); foreach (DataRow dr in ds.Tables[0].Rows) { ProductDetail model = new ProductDetail(); model.FillData(dr); list.Add(model); } return list; }