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(); } }