// GET: BookManage public ActionResult Index(string bookName, long searchselectedID = 0, bool? isAvaliable = null, Int32 pageIndex = 0) { if (!string.IsNullOrEmpty(bookName)) { bookName = bookName.Trim(); } BookManageIndexModel model = new BookManageIndexModel(); BookInfoCondition condition = new BookInfoCondition(); condition.BookName = bookName; condition.CategoryID = searchselectedID; condition.IsAvaliable = isAvaliable; IEnumerable<BookInfo> books = this.IBookInfoDataProvider.GetBookList(condition); PagingContentFormat2<BookInfo> paging = new PagingContentFormat2<BookInfo>(books, pageIndex, 6); foreach (var item in paging.EntityList) { model.BookModelList.Add(BookModel.GetViewModel(item, this.LoginUser())); } model.SearchBookName = bookName; model.SearchCategoryList = DropDownListHelper.GetCategorySelectListBySelectedID(searchselectedID); model.PagingContent = paging; return View(model); }
public ActionResult Index(BookManageIndexModel model) { return RedirectToAction("Index", new { bookName = model.SearchBookName, searchselectedID = model.SearchSelectedID, isAvaliable = model.IsAvaliable }); }