private void Question_Result() { String AnswerInfo_Name = ""; int QuestionSelect_SpScore = 0; int AnswerInfo_Max = 0; Hashtable AnswerInfo_Result_Table = new Hashtable(); AnswerInfo_Result_Table.Add("健康", 0); AnswerInfo_Result_Table.Add("亚健康", 1); AnswerInfo_Result_Table.Add("轻度", 2); AnswerInfo_Result_Table.Add("中度", 3); AnswerInfo_Result_Table.Add("重度", 4); String[] AnswerInfo_Result_Array = new String[5]; AnswerInfo_Result_Array[0] = "健康"; AnswerInfo_Result_Array[1] = "亚健康"; AnswerInfo_Result_Array[2] = "轻度"; AnswerInfo_Result_Array[3] = "中度"; AnswerInfo_Result_Array[4] = "重度"; if (list_answerInfo_Score != null && list_answerInfo_Score.Count > 0) { AnswerInfo_Name = "心血管"; if (list_answerInfo_Score.ContainsKey(3)) { int QuestionSelect_Score = Convert.ToInt32(list_answerInfo_Score[3]); if (QuestionSelect_Score >= 60) list_answerResult[AnswerInfo_Name] = "重度"; if (QuestionSelect_Score > QuestionSelect_SpScore) QuestionSelect_SpScore = QuestionSelect_Score; } if (list_answerInfo_Score.ContainsKey(23)) { int QuestionSelect_Score = Convert.ToInt32(list_answerInfo_Score[23]); if (QuestionSelect_Score >= 60) list_answerResult[AnswerInfo_Name] = "重度"; if (QuestionSelect_Score > QuestionSelect_SpScore) QuestionSelect_SpScore = QuestionSelect_Score; } if (!list_answerResult.ContainsKey(AnswerInfo_Name)) { if (list_answerScore.ContainsKey(AnswerInfo_Name)) { int AnswerInfo_ScoreTotal = Convert.ToInt32(list_answerScore[AnswerInfo_Name]); if (AnswerInfo_ScoreTotal >= 0 && AnswerInfo_ScoreTotal <= 10) list_answerResult[AnswerInfo_Name] = "健康"; if (AnswerInfo_ScoreTotal >= 11 && AnswerInfo_ScoreTotal <= 19) list_answerResult[AnswerInfo_Name] = "亚健康"; if (AnswerInfo_ScoreTotal >= 20 && AnswerInfo_ScoreTotal <= 39) list_answerResult[AnswerInfo_Name] = "轻度"; if (AnswerInfo_ScoreTotal >= 40 && AnswerInfo_ScoreTotal <= 79) list_answerResult[AnswerInfo_Name] = "中度"; if (AnswerInfo_ScoreTotal >= 80) list_answerResult[AnswerInfo_Name] = "重度"; } else list_answerResult[AnswerInfo_Name] = "健康"; if (list_answerResult[AnswerInfo_Name].ToString() != "重度") { if (QuestionSelect_SpScore >= 40) list_answerResult[AnswerInfo_Name] = "中度"; if (QuestionSelect_SpScore >= 20 && QuestionSelect_SpScore <= 39 && (list_answerResult[AnswerInfo_Name].ToString() == "健康" || list_answerResult[AnswerInfo_Name].ToString() == "亚健康")) list_answerResult[AnswerInfo_Name] = "轻度"; } } if (AnswerInfo_Max < Convert.ToInt32(AnswerInfo_Result_Table[list_answerResult[AnswerInfo_Name].ToString()])) AnswerInfo_Max = Convert.ToInt32(AnswerInfo_Result_Table[list_answerResult[AnswerInfo_Name].ToString()]); QuestionSelect_SpScore = 0; AnswerInfo_Name = "脑血管"; if (list_answerInfo_Score.ContainsKey(24)) { int QuestionSelect_Score = Convert.ToInt32(list_answerInfo_Score[24]); if (QuestionSelect_Score >= 60) list_answerResult[AnswerInfo_Name] = "重度"; QuestionSelect_SpScore = QuestionSelect_Score; } if (!list_answerResult.ContainsKey(AnswerInfo_Name)) { if (list_answerScore.ContainsKey(AnswerInfo_Name)) { int AnswerInfo_ScoreTotal = Convert.ToInt32(list_answerScore[AnswerInfo_Name]); if (AnswerInfo_ScoreTotal >= 0 && AnswerInfo_ScoreTotal <= 10) list_answerResult[AnswerInfo_Name] = "健康"; if (AnswerInfo_ScoreTotal >= 11 && AnswerInfo_ScoreTotal <= 39) list_answerResult[AnswerInfo_Name] = "亚健康"; if (AnswerInfo_ScoreTotal >= 40 && AnswerInfo_ScoreTotal <= 79) list_answerResult[AnswerInfo_Name] = "轻度"; if (AnswerInfo_ScoreTotal >= 80 && AnswerInfo_ScoreTotal <= 119) list_answerResult[AnswerInfo_Name] = "中度"; if (AnswerInfo_ScoreTotal >= 120) list_answerResult[AnswerInfo_Name] = "重度"; } else list_answerResult[AnswerInfo_Name] = "健康"; if (list_answerResult[AnswerInfo_Name].ToString() != "重度") { if (QuestionSelect_SpScore >= 40) list_answerResult[AnswerInfo_Name] = "中度"; if (QuestionSelect_SpScore >= 20 && QuestionSelect_SpScore <= 39 && (list_answerResult[AnswerInfo_Name].ToString() == "健康" || list_answerResult[AnswerInfo_Name].ToString() == "亚健康")) list_answerResult[AnswerInfo_Name] = "轻度"; } } if (AnswerInfo_Max < Convert.ToInt32(AnswerInfo_Result_Table[list_answerResult[AnswerInfo_Name].ToString()])) AnswerInfo_Max = Convert.ToInt32(AnswerInfo_Result_Table[list_answerResult[AnswerInfo_Name].ToString()]); QuestionSelect_SpScore = 0; AnswerInfo_Name = "老年痴呆"; if (list_answerInfo_Score.ContainsKey(25)) { int QuestionSelect_Score = Convert.ToInt32(list_answerInfo_Score[25]); if (QuestionSelect_Score >= 60) list_answerResult[AnswerInfo_Name] = "重度"; QuestionSelect_SpScore = QuestionSelect_Score; } if (!list_answerResult.ContainsKey(AnswerInfo_Name)) { if (list_answerInfo_Score.ContainsKey(39)) { int QuestionSelect_Score = Convert.ToInt32(list_answerInfo_Score[39]); if (QuestionSelect_Score >= 8) { if (list_answerScore.ContainsKey(AnswerInfo_Name)) { int AnswerInfo_ScoreTotal = Convert.ToInt32(list_answerScore[AnswerInfo_Name]); if (AnswerInfo_ScoreTotal >= 0 && AnswerInfo_ScoreTotal <= 4) list_answerResult[AnswerInfo_Name] = "健康"; if (AnswerInfo_ScoreTotal >= 5 && AnswerInfo_ScoreTotal <= 7) list_answerResult[AnswerInfo_Name] = "亚健康"; if (AnswerInfo_ScoreTotal >= 8 && AnswerInfo_ScoreTotal <= 12) list_answerResult[AnswerInfo_Name] = "轻度"; if (AnswerInfo_ScoreTotal >= 13 && AnswerInfo_ScoreTotal <= 24) list_answerResult[AnswerInfo_Name] = "中度"; if (AnswerInfo_ScoreTotal >= 25) list_answerResult[AnswerInfo_Name] = "重度"; } else list_answerResult[AnswerInfo_Name] = "健康"; } else list_answerResult[AnswerInfo_Name] = "健康"; } if (list_answerResult[AnswerInfo_Name].ToString() != "重度") { if (QuestionSelect_SpScore >= 40) list_answerResult[AnswerInfo_Name] = "中度"; if (QuestionSelect_SpScore >= 20 && QuestionSelect_SpScore <= 39 && (list_answerResult[AnswerInfo_Name].ToString() == "健康" || list_answerResult[AnswerInfo_Name].ToString() == "亚健康")) list_answerResult[AnswerInfo_Name] = "轻度"; } } if (AnswerInfo_Max < Convert.ToInt32(AnswerInfo_Result_Table[list_answerResult[AnswerInfo_Name].ToString()])) AnswerInfo_Max = Convert.ToInt32(AnswerInfo_Result_Table[list_answerResult[AnswerInfo_Name].ToString()]); AnswerInfo_Name = "保健方案"; if (list_answerScore.ContainsKey(AnswerInfo_Name)) { String AnswerInfo_Result = AnswerInfo_Result_Array[AnswerInfo_Max]; Function_QuestionCase function_questionCase = new Function_QuestionCase(); DataTable dt = function_questionCase.Query_QuestionCase(Question_ID, AnswerInfo_Result); if (dt != null && dt.Rows.Count > 0) { int QuestionCase_ID = Convert.ToInt32(dt.Rows[0]["QuestionCase_ID"].ToString()); Function_QuestionManual function_questionManual = new Function_QuestionManual(); dt = function_questionManual.Query_QuestionManual(QuestionCase_ID); if (dt != null && dt.Rows.Count > 0) QuestionCase_Manual = dt.Rows[0]["QuestionManual_Content"].ToString(); Function_QuestionDescription function_questionDescription = new Function_QuestionDescription(); dt = function_questionDescription.Query_QuestionDescription(QuestionCase_ID); if (dt != null && dt.Rows.Count > 0) QuestionCase_Description = dt; } } } AnswerInfo_Result_Table.Clear(); }
private void Question_Result() { String AnswerInfo_Name = ""; int AnswerInfo_ScoreTotal = 0; if (list_answerInfo_Score != null && list_answerInfo_Score.Count > 0) { AnswerInfo_Name = "上火症状"; if (list_answerScore.ContainsKey(AnswerInfo_Name)) { AnswerInfo_ScoreTotal = Convert.ToInt32(list_answerScore[AnswerInfo_Name]); if (AnswerInfo_ScoreTotal == 0) list_answerResult[AnswerInfo_Name] = "健康"; if (AnswerInfo_ScoreTotal >= 1 && AnswerInfo_ScoreTotal <= 20) list_answerResult[AnswerInfo_Name] = "亚健康"; if (AnswerInfo_ScoreTotal >= 21 && AnswerInfo_ScoreTotal <= 40) list_answerResult[AnswerInfo_Name] = "轻度"; if (AnswerInfo_ScoreTotal >= 41 && AnswerInfo_ScoreTotal <= 60) list_answerResult[AnswerInfo_Name] = "中度"; if (AnswerInfo_ScoreTotal >= 61) list_answerResult[AnswerInfo_Name] = "重度"; } else list_answerResult[AnswerInfo_Name] = "健康"; } if (list_answerInfo_Text != null && list_answerInfo_Text.Count > 0) { AnswerInfo_Name = "危险因数"; int p = 0, q = 0; for (int i = 21; i <= 32; i++) { if (list_answerInfo_Text.ContainsKey(i)) { String AnswerInfo_Text = (String)list_answerInfo_Text[i]; if (AnswerInfo_Text == "中度") p++; if (AnswerInfo_Text == "重度") q++; } } if (p >= 3) list_answerResult[AnswerInfo_Name] = "中度"; if (q >= 3) list_answerResult[AnswerInfo_Name] = "重度"; if (!list_answerResult.ContainsKey(AnswerInfo_Name)) { if (list_answerScore.ContainsKey(AnswerInfo_Name)) { AnswerInfo_ScoreTotal = Convert.ToInt32(list_answerScore[AnswerInfo_Name]); Function_QuestionCase function_questionCase = new Function_QuestionCase(); DataTable dt = function_questionCase.Query_QuestionCase(Question_ID, AnswerInfo_ScoreTotal); if (dt != null && dt.Rows.Count > 0) { int QuestionCase_ID = Convert.ToInt32(dt.Rows[0]["QuestionCase_ID"].ToString()); Function_QuestionManual function_questionManual = new Function_QuestionManual(); dt = function_questionManual.Query_QuestionManual(QuestionCase_ID); if (dt != null && dt.Rows.Count > 0) QuestionCase_Manual = dt.Rows[0]["QuestionManual_Content"].ToString(); Function_QuestionDescription function_questionDescription = new Function_QuestionDescription(); dt = function_questionDescription.Query_QuestionDescription(QuestionCase_ID); if (dt != null && dt.Rows.Count > 0) QuestionCase_Description = dt; } } else { list_answerResult[AnswerInfo_Name] = "健康"; Function_QuestionCase function_questionCase = new Function_QuestionCase(); DataTable dt = function_questionCase.Query_QuestionCase(Question_ID, (String)list_answerResult[AnswerInfo_Name]); if (dt != null && dt.Rows.Count > 0) { int QuestionCase_ID = Convert.ToInt32(dt.Rows[0]["QuestionCase_ID"].ToString()); Function_QuestionManual function_questionManual = new Function_QuestionManual(); dt = function_questionManual.Query_QuestionManual(QuestionCase_ID); if (dt != null && dt.Rows.Count > 0) QuestionCase_Manual = dt.Rows[0]["QuestionManual_Content"].ToString(); Function_QuestionDescription function_questionDescription = new Function_QuestionDescription(); dt = function_questionDescription.Query_QuestionDescription(QuestionCase_ID); if (dt != null && dt.Rows.Count > 0) QuestionCase_Description = dt; } } } else { Function_QuestionCase function_questionCase = new Function_QuestionCase(); DataTable dt = function_questionCase.Query_QuestionCase(Question_ID, (String)list_answerResult[AnswerInfo_Name]); if (dt != null && dt.Rows.Count > 0) { int QuestionCase_ID = Convert.ToInt32(dt.Rows[0]["QuestionCase_ID"].ToString()); Function_QuestionManual function_questionManual = new Function_QuestionManual(); dt = function_questionManual.Query_QuestionManual(QuestionCase_ID); if (dt != null && dt.Rows.Count > 0) QuestionCase_Manual = dt.Rows[0]["QuestionManual_Content"].ToString(); Function_QuestionDescription function_questionDescription = new Function_QuestionDescription(); dt = function_questionDescription.Query_QuestionDescription(QuestionCase_ID); if (dt != null && dt.Rows.Count > 0) QuestionCase_Description = dt; } } } }