Example #1
0
        private ProductFilter GetFilter()
        {
            ProductFilter filter = new ProductFilter
                                       {
                                           ProductName = _productNameTextBox.Text,
                                           ProducerName = _producerNameTextBox.Text,
                                           HasDisplay = _hasDisplayCheckBox.Checked,
                                           Interface = _interfaceComboBox.SelectedValue as IOInterface?
                                       };

            if(_minMemoryCapacityCheckBox.Checked)
            {
                filter.MemoryCapacityFrom = (int?)_minMemoryCapacityNumericUpDown.Value;
            }
            if(_maxMemoryCapacityCheckBox.Checked)
            {
                filter.MemoryCapacityTo = (int?)_maxMemoryCapacityNumericUpDown.Value;
            }
            if(_minWarrantyCheckBox.Checked)
            {
                filter.WarrantyFrom = (int?)_minWarrantyNumericUpDown.Value;
            }
            if(_maxWarrantyCheckBox.Checked)
            {
                filter.WarrantyTo = (int?)_maxWarrantyNumericUpDown.Value;
            }

            return filter;
        }
Example #2
0
 public IList<ProductListElement> GetFilteredProducts(ProductFilter filter)
 {
     IProductDAO productDAO = _factory.GetProductDAO();
     return productDAO.GetFilteredProductList(filter);
 }