예제 #1
0
        private void RefreshSearchComboBox()
        {
            // Update Data Grid with new set of products
            ProductSource = ProductTypeComboBox.SelectedItem != null && ProductComboBox != null
                ? _productHandler.GetProducts(productType : (ProductType)ProductTypeComboBox.SelectedIndex)
                : _productHandler.GetItems();

            ProductComboBox?.GetBindingExpression(ProductComboBox.ItemsSourceProperty)?.UpdateTarget();
        }
예제 #2
0
        public ProductWindow()
        {
            _productHandler    = new ProductHandler();
            _alloywheelHandler = new ProductHandler.AlloywheelHandler();
            _batteryHandler    = new ProductHandler.BatteryHandler();
            _tyreHandler       = new ProductHandler.TyreHandler();
            ItemSource         = _productHandler.GetItems();
            ItemTypeSource     = Enum.GetNames(typeof(ProductType)).ToList().GetRange(0, 3);
            LoadAllSources();

            InitializeComponent();
            UpdateControlVisibility();
        }
예제 #3
0
 private AddOrderDialog()
 {
     try
     {
         _productHandler = new ProductHandler();
         Order           = new Order();
         ProductSource   = _productHandler.GetItems();
         InitializeComponent();
         ProductTypeComboBox.ItemsSource = Enum.GetNames(typeof(ProductType));
         ProductTypeComboBox.Focus();
     }
     catch (Exception ex)
     {
         //   Log.Error(ex.Message);
         MessageBox.Show("Exception : " + ex.Message);
     }
 }
예제 #4
0
 private void RefreshDataGrid()
 {
     ItemSource = _productHandler.GetItems(name: SearchTextBox?.Text, productType: (ProductType?)ItemTypeComboBox?.SelectedIndex);
     InventoryDataGrid?.GetBindingExpression(ItemsControl.ItemsSourceProperty)?.UpdateTarget();
 }