public IActionResult List(int pageIndex = 0, int pageSize = 20, PersonSortCriteria criteria = PersonSortCriteria.ById, SortDirection sortDirection = SortDirection.Ascending) { var personBO = new PersonBusinessObject(this.personRepository, this.fileNameGenerator, this.fileManager); var data = personBO.GetPersonsPaged(pageIndex, pageSize, criteria, sortDirection); if (pageIndex > data.GetLastPageIndex()) { pageIndex = data.GetLastPageIndex(); data = personBO.GetPersonsPaged(pageIndex, pageSize, criteria, sortDirection); } return(View("Index", data)); }
private void LoadDataForCurrentPage() { var personBO = new PersonBusinessObject(this.personRepository); this.data = personBO.GetPersonsPaged(this.pageIndex, this.pageSize, this.sortCriteria, this.sortDirection); if (this.pageIndex > data.GetLastPageIndex()) { this.pageIndex = data.GetLastPageIndex(); this.data = personBO.GetPersonsPaged(this.pageIndex, this.pageSize, this.sortCriteria, this.sortDirection); } this.personListingView.Render(this.data); this.menuView.Render(this.data); }
public IActionResult List(int pageIndex = 0, int pageSize = 20, PersonSortCriteria criteria = PersonSortCriteria.ById, SortDirection sortDirection = SortDirection.Ascending) { var personBO = new PersonBusinessObject(this.personRepository); var data = personBO.GetPersonsPaged(criteria, sortDirection); return(View("Index", data)); }