private void btn_add_Click(object sender, EventArgs e) { FormUnitAdd form = new FormUnitAdd(); form.ShowDialog(); updateUnitTable(); }
private void btn_change_Click(object sender, EventArgs e) { int PK_Unit = Convert.ToInt32(dgv_units.SelectedRows[0].Cells[2].Value); Unit changingUnit = Program.db.Units.Find(PK_Unit); if (changingUnit != null) { FormUnitAdd form = new FormUnitAdd(changingUnit); form.ShowDialog(); updateUnitTable(); } }