/// <summary> /// List Of Report /// </summary> /// <returns></returns> public ActionResult Report() { Book.BLL.V_Stock_Book bll = new Book.BLL.V_Stock_Book(); //分页读取 int PageSize = 5; //默认值 int PageIndex = 1; //默认值 string keywords = Convert.ToString(Request.Form["keyword"]); if (Request.Form["pageNum"] != null) { PageSize = Convert.ToInt32(Request.Form["numPerPage"]); PageIndex = Convert.ToInt32(Request.Form["pageNum"]); } //读取该页数据 DataSet ds = bll.GetListByPage("Name like '%" + keywords + "%'", "id", (PageIndex - 1) * PageSize, (PageIndex) * PageSize); List <Book.Model.V_Stock_Book> lst = bll.DataTableToList(ds.Tables[0]); //读取所有记录条数 int TotalCount = bll.GetRecordCount("Name like '%" + keywords + "%'"); ViewBag.TotalCount = TotalCount; ViewBag.PageSize = PageSize; ViewBag.PageIndex = PageIndex; ViewBag.lst = lst; return(View()); }
/// <summary> /// AddOutReport /// </summary> /// <returns></returns> public ActionResult Add() { Book.BLL.V_Stock_Book bll = new Book.BLL.V_Stock_Book(); List <Book.Model.V_Stock_Book> lst = bll.GetModelList("1=1"); ViewBag.lst = lst; return(View()); }