public ActionResult Index(string search, PaginationCommand users) { IPage <User> resultPageUsers = UserService.FindUser(users, search); IList <ProposedUser> proposedUsers = ProposedUserService.GetAll(); UserListViewModel userListModel = new UserListViewModel(resultPageUsers, search, proposedUsers); return(View(userListModel)); }
public ActionResult Index(User currentUser, PaginationCommand acceptedPaymentsPaginationCommand, PaginationCommand declinedPaymentsPaginationCommand) { Require.NotNull(currentUser, "currentUser"); IPage <Payment> pendingPayments = PaymentService.FindPendingPaymentsByUser(new PageRequest(1, 1), currentUser); IPage <Payment> declinedPayments = PaymentService.FindDeclinedPaymentsByUser(new PageRequest(1, 1), currentUser); if (declinedPayments.TotalElements > 0) { /*Es gibt abgelehnte Zahlungen => gehe dorthin*/ return(RedirectToAction("DeclinedPayments")); } else if (pendingPayments.TotalElements > 0) { /*Es gibt abgelehnte Zahlungen => gehe dorthin*/ return(RedirectToAction("PendingPayments")); } else { /*Zeige die vergangenen Zahlungen an*/ return(RedirectToAction("AcceptedPayments")); } }