private void btnBefore_Click(object sender, EventArgs e) { QuestionD1 questionD1 = new QuestionD1(); questionD1.TopMost = false; questionD1.ShowDialog(); this.Close(); }
private void btnNext_Click(object sender, EventArgs e) { if (radCheckC04A.Checked || radCheckC04B.Checked) { string questionResult = radCheckC04A.Checked?"A":"B"; M_QuestionnaireResultDetail question = new M_QuestionnaireResultDetail(); question.QuestionCode = Public.QuestionnaireCode.ZaoAiWeiAi + ".C04"; question.QuestionType = 1; //单选 question.QuestionResult = questionResult; ClientInfo.AddQuestionToQuestionnaire(question, QuestionnaireCode.ZaoAiWeiAi); if (radCheckC04B.Checked) { string questionResultChild = this.radCheckC041A.Checked ? "A" : radCheckC041B.Checked ? "B" : this.radCheckC041C.Checked ? "C" : radCheckC041D.Checked?"D":""; M_QuestionnaireResultDetail questionChild = new M_QuestionnaireResultDetail(); questionChild.QuestionCode = Public.QuestionnaireCode.ZaoAiWeiAi + ".C04.1"; questionChild.QuestionType = 1; //单选 questionChild.QuestionResult = questionResultChild; ClientInfo.AddQuestionToQuestionnaire(questionChild, QuestionnaireCode.ZaoAiWeiAi); } } if (radCheckC05A.Checked) { string questionResult = "A"; M_QuestionnaireResultDetail question = new M_QuestionnaireResultDetail(); question.QuestionCode = Public.QuestionnaireCode.ZaoAiWeiAi + ".C05"; question.QuestionType = 1; //单选 question.QuestionResult = questionResult; ClientInfo.AddQuestionToQuestionnaire(question, QuestionnaireCode.ZaoAiWeiAi); } if (radCheckC05B.Checked) { string questionResultA = "B"; M_QuestionnaireResultDetail questionA = new M_QuestionnaireResultDetail(); questionA.QuestionCode = Public.QuestionnaireCode.ZaoAiWeiAi + ".C05"; questionA.QuestionType = 1; //单选 questionA.QuestionResult = questionResultA; ClientInfo.AddQuestionToQuestionnaire(questionA, QuestionnaireCode.ZaoAiWeiAi); //文本框必填 if (string.IsNullOrEmpty(txtC051.Text)) { MessageBox.Show("请输入酒精摄入量!"); label4.ForeColor = Color.Red; return; } string questionResultB = this.txtC051.Text; M_QuestionnaireResultDetail questionB = new M_QuestionnaireResultDetail(); questionB.QuestionCode = Public.QuestionnaireCode.ZaoAiWeiAi + ".C05.1"; questionB.QuestionType = 3; //填空题 questionB.QuestionResult = questionResultB; ClientInfo.AddQuestionToQuestionnaire(questionB, QuestionnaireCode.ZaoAiWeiAi); } if (radCheckC05C.Checked) { string questionResultA = "C"; M_QuestionnaireResultDetail questionA = new M_QuestionnaireResultDetail(); questionA.QuestionCode = Public.QuestionnaireCode.ZaoAiWeiAi + ".C05"; questionA.QuestionType = 1; //单选 questionA.QuestionResult = questionResultA; ClientInfo.AddQuestionToQuestionnaire(questionA, QuestionnaireCode.ZaoAiWeiAi); string questionResultB = this.radCheckC052A.Checked ? "A" : radCheckC052B.Checked ? "B" : this.radCheckC052C.Checked ? "C" : radCheckC052D.Checked?"D":""; M_QuestionnaireResultDetail questionB = new M_QuestionnaireResultDetail(); questionB.QuestionCode = Public.QuestionnaireCode.ZaoAiWeiAi + ".C05.2"; questionB.QuestionType = 1; //单选 questionB.QuestionResult = questionResultB; ClientInfo.AddQuestionToQuestionnaire(questionB, QuestionnaireCode.ZaoAiWeiAi); } QuestionD1 questionD1 = new QuestionD1(); questionD1.TopMost = false; questionD1.ShowDialog(); this.Close(); }