public ActionResult Delete(string ids) { Book.BLL.V_Stock_In bll = new Book.BLL.V_Stock_In(); Book.BLL.T_STOCK_InBody bll2 = new Book.BLL.T_STOCK_InBody(); //分离逗号的方法 string[] list = ids.Split(','); int flag = 0; for (int i = 0; i < list.Length; i++) { bool result = bll.DeleteList(list[i]); bool result2 = bll.DeleteStr(list[i]); if (result && result2) { flag++; } } if (flag > 0) { MODEL.Message message = BookProject.Public.U_CloseSMess("InList", "InList", "删除入库单成功!"); return(Json(message)); } else { MODEL.Message message = BookProject.Public.U_CloseFMess("InList", "InList", "删除入库单失败!"); return(Json(message)); } }
/// <summary> /// List Of Reports /// </summary> /// <returns></returns> public ActionResult List() { Book.BLL.V_Stock_In bll = new Book.BLL.V_Stock_In(); //List<Book.Model.V_Stock_In> lst = bll.GetModelList("1=1"); 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_In> 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()); }