//Открытие формы добавления private void button1_Click(object sender, EventArgs e) { string state = "add"; AddOrEditProductForm addOrEdit = new AddOrEditProductForm(state, choosenProduct); addOrEdit.ShowDialog(); update(); }
private void button2_Click(object sender, EventArgs e) { if (choosenProduct == "") { MessageBox.Show("Вы ничего не выбрали!"); } else { string state = "edit"; AddOrEditProductForm addOrEdit = new AddOrEditProductForm(state, choosenProduct); addOrEdit.ShowDialog(); update(); } }