private void toolStripMenuItem2_Click(object sender, EventArgs e) { if (dataGridView2.CurrentRow.Tag != null) { var id = Convert.ToInt32(dataGridView2.CurrentRow.Tag); using (UserContext db = new UserContext(Settings.constr)) { var item = db.CalculationConstants.FirstOrDefault(x => x.ID == id); CalculationConstantForm f = new CalculationConstantForm(this, 2, item); f.ShowDialog(); } } }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { CalculationConstantForm f = new CalculationConstantForm(this, 1, null); f.ShowDialog(); }