Ejemplo n.º 1
0
        private void AddPriceValue(Filter filter)
        {
            if (filter == null)
            {
                return;
            }

            var priceFilter = filters.Find(f => f.Id == (int)FilterCategory.Price);
            var item        = filter.Items.FirstOrDefault() as FilterPriceItem;

            if (item == null)
            {
                return;
            }
            var value = new RangeFilterValueModel <decimal>
            {
                Id   = (int)FilterCategory.Price,
                From = StormContext.ShowPricesIncVat.GetValueOrDefault(true) ? item.FromIncVat : item.From,
                To   = StormContext.ShowPricesIncVat.GetValueOrDefault(true) ? item.ToIncVat : item.To,
            };

            priceFilter.Values.Add(value);
        }
Ejemplo n.º 2
0
        private static void CreateAndAddRangerFilter <T>(T from, T to, FilterRangeItem rangeItem, FilterModel filter) where T : IComparable
        {
            var fvm = new RangeFilterValueModel <T>(from, to, rangeItem);

            filter.Values.Add(fvm);
        }