/// <summary> /// List of OutReport /// </summary> /// <returns></returns> public ActionResult List() { Book.BLL.V_Stock_Out bll = new Book.BLL.V_Stock_Out(); int PageSize = 5;//默认值 int PageIndex = 1; string keywords = Convert.ToString(Request.Form["keywords"]); if (Request.Form["pageNum"] != null) { PageSize = Convert.ToInt32(Request.Form["numPerPage"]); PageIndex = Convert.ToInt32(Request.Form["pageNum"]); } //读取该页的数据 DataSet ds = bll.GetListByPage("id like '%" + keywords + "%'", "id", (PageIndex - 1) * PageSize, PageIndex * PageSize); List <Book.Model.V_Stock_Out> lst = bll.DataTableToList(ds.Tables[0]); int totalcount = bll.GetRecordCount("id like '%" + keywords + "%'"); ViewBag.pagesize = PageSize; ViewBag.pageindex = PageIndex; ViewBag.lst = lst; ViewBag.totalcount = totalcount; return(View()); }