private void cbEngineType_SelectedIndexChanged(object sender, EventArgs e) { engineType enType = (engineType)cbEngineType.SelectedItem; modelDTO.engineType = enType.engineTypeId; if (enType.engineTypeId != 0) { List <engine> eng = new List <engine>(); eng.AddRange(enType.engines.ToList()); if (cbCompany.SelectedIndex != 0) { manufacturer m = (manufacturer)cbCompany.SelectedItem; eng.Union(m.engines .Where(o => o.engineType == enType.engineTypeId).ToList()); eng = eng.Where(o => o.manufacturer == m.manufacturerId).ToList(); if (eng.Count == 0) { cbEngine.Text = ""; } } cbEngine.DataSource = eng; } }
public Engine(engineType _engine, int _level) { engine = _engine; level = _level; maxHp = level; currentHp = maxHp; maxPwr = level; }
public void addCarEngineTypes(ComboBox cb) { engineType all = new engineType(); all.engineType1 = "все"; all.engineTypeId = 0; List <engineType> objs = new List <engineType>(); objs.Add(all); objs.AddRange(db.engineTypes.ToList()); cb.DataSource = objs; }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { int id = Convert.ToInt32(dataGridView1.CurrentRow.Cells["engineTypeIdDataGridViewTextBoxColumn"].Value); engineType eng = db.engineTypes.Find(id); if (e.ColumnIndex == 2) { caller.engineType = eng; caller.tbType.Text = eng.engineType1; caller.typePicked = true; MessageBox.Show("Выбрано " + eng.engineType1); this.Close(); } }
/* * Quick and dirty non-general function * for parsing command line arguments */ public static void Parse(string[] args) { // defaults EngineType = engineType.vm; RunType = runType.repl; EnableBenchmark = false; ArgsFileIndex = 0; for (int i = 0; i < args.Length; i++) { string s = args[i]; if (s.StartsWith("-engine=")) { if (s == "-engine=eval") { EngineType = engineType.eval; } EnableBenchmark = true; } else { ArgsFileIndex = i; } } if (EnableBenchmark && args.Length > 1) { RunType = runType.file; } if (!EnableBenchmark && args.Length > 0) { RunType = runType.file; } }
public Pickup(double NewLoadCapacity, string NewName, int NewNumberOfDoors, engineType NewEngineType) : base(NewName, NewNumberOfDoors) { this.LoadCapacity = NewLoadCapacity; this.currentEngine = NewEngineType; }
public Engine() { engine = engineType.other; level = -1; }