private void button1_Click(object sender, EventArgs e) { Form obj; if (anamecombo.Text == "" || aDob.Text == "" || agency.Text == "") { MessageBox.Show("Empty field", "warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { try { } catch { MessageBox.Show("Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } DialogResult d; d = MessageBox.Show("Record updated successfuly\nWould you like to insert one more?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (d == DialogResult.Yes) { Close(); obj = new updateAgency(); obj.Show(); } else { Close(); obj = new updatemain(); obj.Show(); } } }
private void button1_Click(object sender, EventArgs e) { Form obj; if (radioButton1.Checked == true) { this.Hide(); obj = new updateNetwork(); obj.Show(); } else if (radioButton2.Checked == true) { this.Hide(); obj = new updateProduction(); obj.Show(); } else if (radioButton3.Checked == true) { this.Hide(); obj = new updateAgency(); obj.Show(); } else { MessageBox.Show("No option selected..", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.Hide(); obj = new updatemain(); obj.Show(); } }
private void button1_Click(object sender, EventArgs e) { if (radioButton1.Checked) { Form obj1 = new insertmain(); this.Hide(); obj1.Show(); } else if (radioButton2.Checked) { Form obj2 = new updatemain(); this.Hide(); obj2.Show(); } else if (radioButton3.Checked) { Form obj3 = new deletemain(); this.Hide(); obj3.Show(); } else if (radioButton4.Checked) { Form obj4 = new joinmain(); this.Hide(); obj4.Show(); } else { DialogResult d; d = MessageBox.Show("Select one from above.", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (d == DialogResult.OK) { Close(); Form obj1 = new form2(); obj1.Show(); } } }