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) { Form obj; if (sCombo.Text == "" || networkTB.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 updateNetwork(); obj.Show(); } else { Close(); obj = new updatemain(); obj.Show(); } } }