private void button5_Click(object sender, EventArgs e) { Form6 m = new Form6(); m.Show(); }
private void Update_Click(object sender, EventArgs e) { text = true; grade = true; if (string.IsNullOrWhiteSpace(textBox1.Text)) { MessageBox.Show("You should enter content in the textbox"); text = false; } if (string.IsNullOrWhiteSpace(textBox2.Text)) { MessageBox.Show("You should enter content in the textbox"); text = false; } if (string.IsNullOrWhiteSpace(textBox3.Text)) { MessageBox.Show("You should enter content in the textbox"); text = false; } if (string.IsNullOrWhiteSpace(textBox4.Text)) { MessageBox.Show("You should enter content in the textbox"); text = false; } if (string.IsNullOrWhiteSpace(textBox5.Text)) { MessageBox.Show("You should enter content in the textbox"); text = false; } if (string.IsNullOrWhiteSpace(textBox6.Text)) { MessageBox.Show("You should enter content in the textbox"); text = false; } if (string.IsNullOrWhiteSpace(textBox8.Text)) { MessageBox.Show("You should enter content in the textbox"); text = false; } string SuID = textBox8.Text.ToString(); Regex reg = new Regex("^[0-9]+$"); Match ma = reg.Match(SuID); if (!ma.Success) { MessageBox.Show("You should enter integer in percentage"); text = false; } if (text) { if (Convert.ToInt32(textBox8.Text.ToString()) > 100) { MessageBox.Show("You shouldn't enter integer in percentage excceed 100"); grade = false; } } if (text == true && grade == true) { updateXML(float.Parse(dgvr.Cells[1].Value.ToString()), textBox1.Text, textBox8.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text); this.Close(); Form6 f6 = new Form6(name); f6.Show(); } }