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