private void создатьToolStripMenuItem_Click(object sender, EventArgs e) { NewModelForm form = new NewModelForm(); if (form.ShowDialog() == DialogResult.OK) { UpdateData(); } }
private void редактироватьToolStripMenuItem_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 0) { ModelCar modelCar = dataGridView1.SelectedRows[0].DataBoundItem as ModelCar; NewModelForm form = new NewModelForm(modelCar); if (form.ShowDialog() == DialogResult.OK) { UpdateData(); } } }