Esempio n. 1
0
        public ActionResult News(SearchCriteria criteria)
        {
            NewsQueryBuilder queryBuilder = new NewsQueryBuilder(criteria);
            var result = queryBuilder.Execute(daoTemplate.Session);

            SetNewsArticleToViewData();

            return View(result);
        }
Esempio n. 2
0
 public SearchResults(int pageCount, SearchCriteria criteria, IEnumerable <T> results)
 {
     PageCount = pageCount;
     Criteria  = criteria;
     Results   = results;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 protected QueryBuilder(SearchCriteria criteria)
 {
     _searchCriteria = criteria;
     DaoTemplate     = new DaoTemplate();
 }