private void button1_Click(object sender, EventArgs e) { Admin f = new Admin(); f.add_course(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text); this.Hide(); MessageBox.Show("Done !"); }
private void button1_Click_1(object sender, EventArgs e) { Admin f = new Admin(); f.add_course(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text); if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrEmpty(textBox2.Text) || string.IsNullOrEmpty(textBox3.Text) || string.IsNullOrEmpty(textBox4.Text) || string.IsNullOrEmpty(textBox5.Text)) { MessageBox.Show("Please check that all information enterd succssefully!"); } else { MessageBox.Show("Done !"); } }