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