/// <summary> /// 获取产品列表 /// </summary> /// <param name="keyWords">关键词</param> /// <param name="pageSize">页Size</param> /// <param name="pageIndex">页码</param> /// <param name="totalCount">总数</param> /// <param name="pageCount">总页数</param> /// <param name="clientID">客户端ID</param> /// <returns></returns> public List<Products> GetProductList(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID) { var dal = new ProductsDAL(); DataSet ds = dal.GetProductList(keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, clientID); List<Products> list = new List<Products>(); foreach (DataRow dr in ds.Tables[0].Rows) { Products model = new Products(); model.FillData(dr); list.Add(model); } return list; }
public List<Products> GetProductList(string categoryid, string beginprice, string endprice, string keyWords, string orderby, bool isasc, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID) { var dal = new ProductsDAL(); DataSet ds = dal.GetProductList(categoryid, beginprice, endprice, keyWords, orderby, isasc ? 1 : 0, pageSize, pageIndex, ref totalCount, ref pageCount, clientID); List<Products> list = new List<Products>(); foreach (DataRow dr in ds.Tables[0].Rows) { Products model = new Products(); model.FillData(dr); list.Add(model); } return list; }
public DataTable GetProductListDataTable(string categoryid, string beginprice, string endprice, string keyWords, string orderby, bool isasc, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID) { DataTable dt=new DataTable(); var dal = new ProductsDAL(); DataSet ds = dal.GetProductList(categoryid, beginprice, endprice, keyWords, orderby, isasc ? 1 : 0, pageSize, pageIndex, ref totalCount, ref pageCount, clientID); if (ds.Tables.Count > 0) { dt = ds.Tables[0]; } return dt; }