private void button_engine_edit_Click(object sender, EventArgs e) { int index; try { index = dataGridView_engine.SelectedRows[0].Index; } catch { index = 0; } int id; bool converted = Int32.TryParse(dataGridView_engine[0, index].Value.ToString(), out id); if (converted == false) { return; } Engine engine = db.Engines.Find(id); Engine_Add edit = new Engine_Add(); edit.getEngine = engine.Type_Engine; edit.label_engine_add_body.Visible = false; edit.button_engine_add_add_body.Visible = false; edit.button_engine_add_edit_body.Visible = false; edit.textBox_engine_add_body.Visible = false; edit.button_engine_add_Add_eng.Visible = false; edit.ShowDialog(); engine.Type_Engine = edit.getEngine; db.SaveChanges(); Refresh_Engine(); }
private void button_engine_add_Click(object sender, EventArgs e) { Engine_Add engine = new Engine_Add(); engine.label_engine_add_body.Visible = false; engine.button_engine_add_add_body.Visible = false; engine.button_engine_add_edit_body.Visible = false; engine.textBox_engine_add_body.Visible = false; engine.button_engine_add_edit_engine.Visible = false; engine.ShowDialog(); Refresh_Engine(); }
private void button_body_add_Click(object sender, EventArgs e) { Engine_Add body = new Engine_Add(); body.label_engine_add_engine.Visible = false; body.button_engine_add_Add_eng.Visible = false; body.button_engine_add_edit_engine.Visible = false; body.textBox_engine_add_engine.Visible = false; body.button_engine_add_edit_body.Visible = false; body.ShowDialog(); Refresh_Body(); }