public ActionResult Index(string order) { string message = (string)TempData["StatusMessage"]; ViewBag.message = message; var options = new InvoiceFilterOptions() { Order = string.IsNullOrEmpty(order) ? string.Empty : order.ToLower() }; ViewBag.order = order; List<Invoice> model = _invoiceService.GetAll(options); return View(model); }
public ActionResult RenderItems(int? page, string order) { string message = (string)TempData["StatusMessage"]; ViewBag.message = message; var options = new InvoiceFilterOptions() { Order = string.IsNullOrEmpty(order) ? string.Empty : order.ToLower() }; ViewBag.order = order; int pageNo = page ?? 1; int total = _invoiceService.Total(options); int totalPages = System.Convert.ToInt32(Math.Ceiling((decimal)total / (decimal)10)); if (totalPages > pageNo) ViewBag.Next = (pageNo + 1); var model = _invoiceService.GetAll(options, new PagingSettings() { PageCount = 10, PageIndex = pageNo }); return PartialView("Controls/_RenderItems", model); }