public ActionResult ListAjax(CustomerListModel model, CustomerListPagingFilteringModel command) { command.PageSize = 15; if (command.PageNumber <= 0) command.PageNumber = 1; //fiter customer var customers = _customerService.GetAllCustomers(pageIndex: command.PageNumber - 1, pageSize: command.PageSize); model.Customers = customers; model.PagingFilteringContext.LoadPagedList(customers); return PartialView(model); }
public ActionResult List(CustomerListModel model) { if (null == model) model = new CustomerListModel(); var roles = _customerService.GetAllCustomerRoles(); model.AvailableRoles = roles.ToSelectItems(); model.AvailableRoles.Insert(0, new SelectListItem() { Text = "请选择", Value = "0" }); return View(model); }