//上一页 private void btnBefore_Click(object sender, EventArgs e) { var thahTwo = new ThahTwo { TopMost = false }; thahTwo.Show(); Close(); }
//下一步 private void btnNext_Click(object sender, EventArgs e) { //判断 if ((!rbQ1A.Checked && !rbQ1B.Checked) || string.IsNullOrEmpty(txtQ2.Text)) { var msgBox = new CustomMessageBox("请答完本页所有题目再进入下一题!"); msgBox.ShowDialog(); return; } if (double.Parse(txtQ2.Text) < 6 || double.Parse(txtQ2.Text) > 17) { var msgBox = new CustomMessageBox("年龄范围为6-17周岁!"); msgBox.ShowDialog(); txtQ2.Text = string.Empty; txtQ2.Focus(); return; } //保存答案 //第一题 M_QuestionnaireResultDetail question1 = new M_QuestionnaireResultDetail { QuestionResult = rbQ1A.Checked ? "A," : "B,", QuestionCode = QuestionnaireCode.Thah + ".1", PQuestionCode = QuestionnaireCode.Thah + ".1", QuestionType = 1, QuestionScore = 0, PQuestionWeightScore = 0 }; ClientInfo.AddQuestionToQuestionnaire(question1, QuestionnaireCode.Thah); //第二题 M_QuestionnaireResultDetail question2 = new M_QuestionnaireResultDetail { QuestionResult = (int)double.Parse(txtQ2.Text) + ",", QuestionCode = QuestionnaireCode.Thah + ".2", PQuestionCode = QuestionnaireCode.Thah + ".2", QuestionType = 3, QuestionScore = 0, PQuestionWeightScore = 0 }; ClientInfo.AddQuestionToQuestionnaire(question2, QuestionnaireCode.Thah); //跳转 ThahTwo thahTwo = new ThahTwo { TopMost = false }; thahTwo.Show(); Close(); }