private void StudentButton_Click(object sender, EventArgs e) { string A = ""; this.Hide(); CategoryForm options = new CategoryForm(); using (StudentLoginForm StudentLogin = new StudentLoginForm()) { StudentLogin.ShowDialog(); if (StudentLogin.showcat()) { stud.Email = StudentLogin.GetEmail(); stud.Name = StudentLogin.GetName(); options.ShowDialog(); if (options.done()) { options.Close(); stud.setTopics(options.GetTopics()); NumOfQ = options.QNum(); } foreach (var s in options.GetTopics()) { A += s.ToString(); } MessageBox.Show(stud.Name + stud.Email + A + NumOfQ.ToString()); } } }
private void StuLoginNextButton_Click(object sender, EventArgs e) { if ((NameTextBox.Text != "") && (EmailTextBox.Text != "")) { studentInfo(); this.Hide(); CategoryForm options = new CategoryForm(); options.Show(); if (options.done()) { catdone = true; } } else { if (NameTextBox.Text == "") { MessageBox.Show("Please Enter A Name !", "", MessageBoxButtons.OK); } else if (EmailTextBox.Text == "") { MessageBox.Show("Please Enter An E-mail !", "", MessageBoxButtons.OK); } } }