示例#1
0
        /// <summary>
        /// Applies the filters applicable to this given model.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <returns></returns>
        protected override ITypeSearch <FindProduct> ApplyFilters(ITypeSearch <FindProduct> query)
        {
            if (ProductBrands != null && ProductBrands.Any())
            {
                query = query.Filter(x => GetBrandFilter(ProductBrands));
            }

            //if (category != null && category.Any())
            //    query = query.Filter(x => GetWineTypeFilter(category));

            if (CountryList != null && CountryList.Any())
            {
                query = query.Filter(x => GetCountryFilter(CountryList));
            }

            return(query);
        }
 public ProductCodeWindowViewModel(SainaDbContext uow)
 {
     ProductBrandsDropDownOpenedCommand = new RelayCommand(OnProductBrandsDropDownOpened, () => ProductBrands != null && ProductBrands.Any());
     ProductTypesDropDownOpenedCommand  = new RelayCommand(OnProductTypesDropDownOpened, () => ProductTypes != null && ProductTypes.Any());
     ProductModelsDropDownOpenedCommand = new RelayCommand(OnProductModelsDropDownOpened, () => ProductModels != null && ProductModels.Any());
     OtherProductsDropDownOpenedCommand = new RelayCommand(OnOtherProductsDropDownOpened, () => OtherProducts != null && OtherProducts.Any());
     _uow          = uow;
     ProductBrands = new ObservableCollection <ProductBrand>();
 }
示例#3
0
        public ProductListViewModel(IShoppingSystemSettingsService shoppingSystemSettingsService, SainaDbContext uow)
        {
            _shoppingSystemSettingsService = shoppingSystemSettingsService;
            AddBrandCommand = new RelayCommand(OnAddProduct);

            ApplyCommand = new RelayCommand(OnApply);
            ProductDropDownOpenedCommand = new RelayCommand(OnProductModelsDropDownOpened, () => ProductBrands != null && ProductBrands.Any());
            _uow             = uow;
            ProductBrands    = new ObservableCollection <ProductBrand>();
            OtherProducts    = new ObservableCollection <OtherProduct>();
            ProductTypes     = new ObservableCollection <ProductType>();
            ProductModels    = new ObservableCollection <ProductModel>();
            MeasurementUnits = new ObservableCollection <MeasurementUnit>();
            // Stocks = new ObservableCollection<Stock>();
            //InventoryControl = new InventoryControl();
        }