public ActionResult Index() { BaseballView baseballView = new BaseballView(_queryBuilder); baseballView.ConstructView(); return View(baseballView); }
public static string TableHeaderLink(this HtmlHelper helper, BaseballView view, string idToSet, string headerToSet) { string linkFormat = "<a href=\"javascript:void(0);\" class=\"result_sort{0}\" id=\"id_{1}\">{2}</a>"; string sortClass = (view.SortTerm == idToSet) ? " current_sort_header" : String.Empty; return string.Format(linkFormat, sortClass, idToSet, headerToSet); }
public ActionResult Query(string sortTerm, string sortDir, string facets, string searchTerm) { _queryBuilder.SearchTerm = searchTerm; if (!string.IsNullOrEmpty(facets)) { facets.Split(',').ToList().ForEach(f => { string[] keyVal = f.Split('^'); _queryBuilder.AppliedFacets.Add(new Tuple<string, string>(keyVal[0], keyVal[1])); }); } _queryBuilder.CurrentSortTerm = sortTerm; _queryBuilder.SortDirection = sortDir; BaseballView baseballView = new BaseballView(_queryBuilder); baseballView.ConstructView(); return View(baseballView); }