Esempio n. 1
0
        public ActionResult Index(CompositionFilter filter)
        {
            var filteredCompositions = _filterService.ApplyFilter(filter);

            InitializeFilterModel(filter);
            ViewBag.Filter = filter;

            return(View(filteredCompositions));
        }
Esempio n. 2
0
        public IEnumerable <Expenditure> FilterSpents(IEnumerable <FilterCriteria> criterias)
        {
            IEnumerable <Expenditure> filteredResults;

            if (criterias.Count() == 0)
            {
                filteredResults = _context.Expenditures;
            }
            else
            {
                var filter = FilterFactory <Expenditure> .Create(criterias);

                var spentFilterService = new FilterService <Expenditure>(filter);
                filteredResults = spentFilterService.ApplyFilter(_context.Expenditures);
            }
            return(filteredResults);
        }