public ActionResult Index(int?page) { var pageNumber = page ?? 1; var objectsPerPage = 20; var startIndex = (pageNumber - 1) * objectsPerPage; SearchParamsBase SearchParams = new SearchParamsBase(startIndex, objectsPerPage); var searchResult = _filterRepository.Get(SearchParams); var viewModel = SearchResultViewModel <Pyramid.Entity.Filter> .CreateFromSearchResult(searchResult, i => i, 10); return(View(viewModel)); }
public void Get_Should_return_Correct_Subtitle_Values() { RunTest(() => { var values = _filterRepository.Get("subtitle", new[] { "1", "2" }); values.Should().NotBeNull(); values.Id.Should().Be("10"); values.Field.Should().Be("subtitle"); values.Libraries.Length.Should().Be(2); values.Libraries[0].Should().Be("1"); values.Libraries[1].Should().Be("2"); values.Values.Length.Should().Be(2); values.Values[0].Label.Should().Be("1"); values.Values[0].Value.Should().Be("1"); values.Values[1].Label.Should().Be("2"); values.Values[1].Value.Should().Be("2"); }); }
public ActionResult GetProductTemplateDropDownListForFilterId(int id = 0, int indx = 0) { var filter = _filterRepository.Get(id); IEnumerable <SelectListItem> outEnumValues; if (filter != null) { outEnumValues = filter.EnumValues.Select(item => new SelectListItem { Text = item.Key, Value = item.Id.ToString() }); } else { outEnumValues = new List <SelectListItem>(); } ViewBag.EnumValuesSelectList = outEnumValues; return(PartialView(indx)); }