private void button1_Click(object sender, EventArgs e) { try { Met13 m = new Met13(); m.Delete(comboBox1.Items[comboBox1.SelectedIndex].ToString()); this.Close(); } catch { MessageBox.Show("Error"); } }
private void button1_Click(object sender, EventArgs e) { try { Met13 d = new Met13(); d.ADD(textBox1.Text, Convert.ToInt32(textBox2.Text), textBox3.Text); this.Close(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Не все поля заполнены"); } catch { MessageBox.Show("Error"); } }
private void button1_Click(object sender, EventArgs e) { try { Met13 m = new Met13(); m.Edit(Convert.ToInt32(comboBox1.Items[comboBox1.SelectedIndex]), textBox1.Text, Convert.ToInt32(textBox2.Text), textBox3.Text); this.Close(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Не все поля заполнены"); } catch { MessageBox.Show("Error"); } }