public void OnGet() { if (this.SearchTerm == null) { this.SearchTerm = string.Empty; return; } AddSearchResults(authors.Search(SearchTerm)); AddSearchResults(books.Search(SearchTerm)); AddSearchResults(movies.Search(SearchTerm)); AddSearchResults(directors.Search(SearchTerm)); Page(); }
public JsonResult GetDirectorList(string searchTerm) { var list = _directorService.GetAll(); if (searchTerm != null) { list = _directorService.Search(searchTerm); } var modifiedData = list.Select(t => new { id = t.Id, text = t.NameDirector }); return(Json(modifiedData, JsonRequestBehavior.AllowGet)); }
public PartialViewResult GetPaging(int?page) { int pageSize = 5; int pageNumber = (page ?? 1); if (Session["PageList"] != null) { var name = Session["PageList"].ToString(); var listSearch = _directorService.Search(name); var listSearchModel = AutoMapper.Mapper.Map <IEnumerable <DirectorViewModel> >(listSearch); return(PartialView("_PartialViewDirector", listSearchModel.ToPagedList(pageNumber, pageSize))); } return(PartialView("_PartialViewDirector", _listDirectorViewModel.ToPagedList(pageNumber, pageSize))); }