private void cmbSeries_SelectionChanged(object sender, SelectionChangedEventArgs e) { switch (cmbSeries.SelectedIndex) { case 0: mSeries = Series.BMW_1_SERIES; break; case 1: mSeries = Series.BMW_3_SERIES; break; case 2: mSeries = Series.BMW_5_SERIES; break; case 3: mSeries = Series.BMW_7_SERIES; break; case 4: mSeries = Series.BMW_X5; break; } switch (mSeries) { case Series.BMW_1_SERIES: mCar = new MyCar(Series.BMW_1_SERIES); list_bodies = adapter.getAllBodies_1_Series().ToList<Товары>(); list_engines = adapter.getAllEngine_1_Series().ToList<Товары>(); list_transmissions = adapter.getAllTransmission_1_Series().ToList<Товары>(); resetCounters(); break; case Series.BMW_3_SERIES: mCar = new MyCar(Series.BMW_3_SERIES); list_bodies = adapter.getAllBodies_3_Series().ToList<Товары>(); list_engines = adapter.getAllEngine_3_Series().ToList<Товары>(); list_transmissions = adapter.getAllTransmission_3_Series().ToList<Товары>(); resetCounters(); break; case Series.BMW_5_SERIES: mCar = new MyCar(Series.BMW_5_SERIES); list_bodies = adapter.getAllBodies_5_Series().ToList<Товары>(); list_engines = adapter.getAllEngine_5_Series().ToList<Товары>(); list_transmissions = adapter.getAllTransmission_5_Series().ToList<Товары>(); resetCounters(); break; case Series.BMW_7_SERIES: mCar = new MyCar(Series.BMW_7_SERIES); list_bodies = adapter.getAllBodies_7_Series().ToList<Товары>(); list_engines = adapter.getAllEngine_7_Series().ToList<Товары>(); list_transmissions = adapter.getAllTransmission_7_Series().ToList<Товары>(); resetCounters(); break; case Series.BMW_X5: mCar = new MyCar(Series.BMW_X5); list_bodies = adapter.getAllBodies_X5_Series().ToList<Товары>(); list_engines = adapter.getAllEngine_X5_Series().ToList<Товары>(); list_transmissions = adapter.getAllTransmission_X5_Series().ToList<Товары>(); resetCounters(); break; } updateCurrentItem(); }
public winСборка(DataBaseAdapter adapter, MyCar car) { InitializeComponent(); this.adapter = adapter; this.mCar = car; cmbClient.ItemsSource = adapter.getNamesClient(); Товары item = adapter.getEngineById(mCar.get_id_engine()); switch (car.getSeries()) { case ConstructorView.Series.BMW_1_SERIES: cmbPr.Items.Add("Задний"); if (item.Наименование.Contains("136")) { txtName.Text = "BMW 1 Series 116i"; txtPrice.Text = "875000 руб."; } else { if (item.Наименование.Contains("170")) { txtName.Text = "BMW 1 Series 118i"; txtPrice.Text = "995000 руб."; } else { txtName.Text = "BMW 1 Series 120d"; txtPrice.Text = "1120000 руб."; } } break; case ConstructorView.Series.BMW_3_SERIES: cmbPr.Items.Add("Задний"); if (item.Наименование.Contains("306")) { txtName.Text = "BMW 3 Series 335i"; txtPrice.Text = "1900000 руб."; } else { if (item.Наименование.Contains("дизельный")) { txtName.Text = "BMW 3 Series 320d"; txtPrice.Text = "1650000 руб."; } else { txtName.Text = "BMW 3 Series 320i"; txtPrice.Text = "1350000 руб."; } } break; case ConstructorView.Series.BMW_5_SERIES: if (item.Наименование.Contains("184")) { txtName.Text = "BMW 5 Series 520i"; txtPrice.Text = "1820000 руб."; cmbPr.Items.Add("Задний"); } else { if (item.Наименование.Contains("258")) { txtName.Text = "BMW 5 Series 530d"; txtPrice.Text = "2150000 руб."; cmbPr.Items.Add("Задний"); } else { txtName.Text = "BMW 5 Series 550i xDrive"; txtPrice.Text = "3240000 руб."; cmbPr.Items.Add("Полный"); } } break; case ConstructorView.Series.BMW_7_SERIES: if (item.Наименование.Contains("250")) { txtName.Text = "BMW 7 Series 730i"; txtPrice.Text = "320000 руб."; cmbPr.Items.Add("Задний"); } else { if (item.Наименование.Contains("245")) { txtName.Text = "BMW 7 Series 730d"; txtPrice.Text = "3500000 руб."; cmbPr.Items.Add("Задний"); } else { if (item.Наименование.Contains("407")) { txtName.Text = "BMW 7 Series 750i xDrive"; txtPrice.Text = "4650000руб."; cmbPr.Items.Add("Полный"); } else { txtName.Text = "BMW 7 Series 760i"; txtPrice.Text = "5600000 руб."; cmbPr.Items.Add("Задний"); } } } break; case ConstructorView.Series.BMW_X5: cmbPr.Items.Add("Полный"); if (item.Наименование.Contains("245")) { txtName.Text = "BMW X5 30d"; txtPrice.Text = "3028000 руб."; } else { if (item.Наименование.Contains("306")) { txtName.Text = "BMW X5 35i"; txtPrice.Text = "2919000 руб."; } else { txtName.Text = "BMW X5 50i"; txtPrice.Text = "3718000 руб."; } } cmbColor.Items.Add("Искрящийся"); break; } }