public ActionResult ShowInvoiceList(string viewName, Models.InvoiceListFilter filter, int? size) { if (!size.HasValue) { size = 10; } int count = 0; var list = SalesService.GetInvoiceList(User.GetUserPrincipal().CurrentUser, filter, 0, size.Value, out count); var model = new Models.InvoiceList(list); model.ItemCount = count; model.PageIndex = 0; model.PageSize = size.Value; ViewData.Model = model; return PartialView(viewName); }
public ActionResult Index(Models.InvoiceListFilter filter, int? page, int? size) { var pageId = GetPageId(page); if (!size.HasValue) { size = 10; } int count = 0; var list = SalesService.GetInvoiceList(User.GetUserPrincipal().CurrentUser, filter, pageId, size.Value, out count); var model = new Models.InvoiceList(list); model.ItemCount = count; model.PageIndex = pageId + 1; model.PageSize = size.Value; ViewData.Model = model; return GetDefaultView("invoicelist"); }