コード例 #1
0
        public ActionResult Index()
        {
            BaseballView baseballView = new BaseballView(_queryBuilder);

            baseballView.ConstructView();

            return View(baseballView);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }