예제 #1
0
        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));
        }
예제 #2
0
        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");
            });
        }
예제 #3
0
        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));
        }