/// <summary> /// Load new sources when initializing the window, and update combo boxes /// </summary> private void LoadSources() { switch (_productType) { case ProductType.Alloywheel: BrandSource = _alloywheelHandler.GetBrands(); DimensionSource = _alloywheelHandler.GetDimensions(); CountrySource = null; break; case ProductType.Battery: BrandSource = _batteryHandler.GetBrands(); DimensionSource = null; CountrySource = null; break; case ProductType.Tyre: BrandSource = _tyreHandler.GetBrands(); DimensionSource = _tyreHandler.GetDimensions(); CountrySource = _tyreHandler.GetCountries(); break; default: throw new ArgumentOutOfRangeException(); } }
/// <summary> /// Updates the source variables from database /// </summary> private void LoadAllSources() { _tyreBrandSource = _tyreHandler.GetBrands(); _tyreDimensionSource = _tyreHandler.GetDimensions(); _tyreCountrySource = _tyreHandler.GetCountries(); _alloywheelBrandSource = _alloywheelHandler.GetBrands(); _alloywheelDimensionSource = _alloywheelHandler.GetDimensions(); _batteryBrandSource = _batteryHandler.GetBrands(); _batteryCapacitySource = null; _batteryVoltageSource = null; }