public ActionResult News(SearchCriteria criteria) { NewsQueryBuilder queryBuilder = new NewsQueryBuilder(criteria); var result = queryBuilder.Execute(daoTemplate.Session); SetNewsArticleToViewData(); return View(result); }
public SearchResults(int pageCount, SearchCriteria criteria, IEnumerable <T> results) { PageCount = pageCount; Criteria = criteria; Results = results; }
public string Link(SearchCriteria criteria) { PropertyInfo[] propertyInfos = criteria.GetType().GetProperties(); var nameValues = new List<NameValue>(); foreach (PropertyInfo propertyInfo in propertyInfos) { if (propertyInfo.GetCustomAttributes(typeof(LinkAttribute), false).Length > 0) if (propertyInfo.GetValue(criteria, null) != null) nameValues.Add( new NameValue( propertyInfo.Name, propertyInfo.GetValue(criteria, null).ToString())); } string queryString = string.Join("&", nameValues.Select(x => x.ToString()).ToArray()); return "" + "?" + queryString; }
protected QueryBuilder(SearchCriteria criteria) { _searchCriteria = criteria; DaoTemplate = new DaoTemplate(); }