public ActionResult Index(string selectSort, string UserId, string role, int?page, string searchString, string selectFilter, string filterString) { ViewBag.SelectSort = new SelectList(sortModel.Options); ViewBag.SelectFilter = new SelectList(filterModel.Options); var tickets = TicketHelper.GetTickets(UserId, role); if (selectSort != null) { tickets = TicketHelper.SortTickets(tickets, selectSort); } if (!String.IsNullOrEmpty(filterString)) { tickets = TicketHelper.FilterTickets(tickets, selectFilter, filterString); } if (!String.IsNullOrEmpty(searchString)) { tickets = TicketHelper.GetTickets(UserId, role).Where(t => t.Title.Contains(searchString) || t.Description.Contains(searchString)).ToList(); } return(View(PaginateList(tickets, page))); }
public ActionResult FilterTickets(TicketFilter filters) { var tickties = TicketHelper.FilterTickets(filters); return(View(tickties)); }