private ActionResult RunDetailedSearch(PersonSearchViewModel item, string pageNumber, string sortBy) { var sortDirection = GetSortDirection(item, sortBy); ModelState.Clear(); var results = _Service.Search( searchValueFirstName: item.FirstName, searchValueLastName: item.LastName, searchValuePhoneNumber: item.PhoneNumber, searchValueEmailAddress: item.EmailAddress, searchValueStatus: item.Status, searchValueCreatedBy: item.CreatedBy, searchValueLastModifiedBy: item.LastModifiedBy, searchValueThingy: item.Thingy, sortBy: sortBy, sortByDirection: sortDirection); var pageableResults = new PageableResults <Person>(); pageableResults.Initialize(results); pageableResults.CurrentPage = pageNumber.SafeToInt32(0); item.Results = pageableResults; item.CurrentSortDirection = sortDirection; item.CurrentSortProperty = sortBy; return(View(item)); }
private ActionResult RunDetailedSearch(LookupSearchViewModel item, string pageNumber, string sortBy) { var sortDirection = GetSortDirection(item, sortBy); ModelState.Clear(); var results = _Service.Search( searchValueLookupType: item.LookupType, searchValueLookupKey: item.LookupKey, searchValueLookupValue: item.LookupValue, searchValueStatus: item.Status, searchValueCreatedBy: item.CreatedBy, searchValueLastModifiedBy: item.LastModifiedBy, sortBy: sortBy, sortByDirection: sortDirection); var pageableResults = new PageableResults <Lookup>(); pageableResults.Initialize(results); pageableResults.CurrentPage = pageNumber.SafeToInt32(0); item.Results = pageableResults; item.CurrentSortDirection = sortDirection; item.CurrentSortProperty = sortBy; return(View(item)); }
private ActionResult RunSimpleSearch( PersonSearchViewModel item, string pageNumber, string sortBy) { if (item.SimpleSearchValue.IsNullOrWhitespace() == false) { ModelState.Clear(); string sortDirection; if (sortBy == null) { // the value didn't change because of HTTP POST sortBy = item.CurrentSortProperty; sortDirection = item.CurrentSortDirection; } else { sortDirection = GetSortDirection(item, sortBy); } var results = _Service.SimpleSearch(item.SimpleSearchValue, sortBy, sortDirection); var pageableResults = new PageableResults <Person>(); pageableResults.Initialize(results); pageableResults.CurrentPage = pageNumber.SafeToInt32(0); item.Results = pageableResults; item.CurrentSortDirection = sortDirection; item.CurrentSortProperty = sortBy; } return(View(item)); }