Esempio n. 1
0
        //上一页
        private void btnBefore_Click(object sender, EventArgs e)
        {
            var thahFour = new ThahFour {
                TopMost = false
            };

            thahFour.Show();
            Close();
        }
Esempio n. 2
0
        //下一页
        private void btnNext_Click(object sender, EventArgs e)
        {
            //判断
            if (string.IsNullOrEmpty(txtQ6A.Text) || string.IsNullOrEmpty(txtQ6B.Text) || (!rbQ7A.Checked && !rbQ7B.Checked && !rbQ7C.Checked) || string.IsNullOrEmpty(txtQ7D.Text))
            {
                var msgBox = new CustomMessageBox("请答完本页所有题目再进入下一题!");
                msgBox.ShowDialog();
                return;
            }
            if (double.Parse(txtQ6A.Text) <= 0)
            {
                var msgBox = new CustomMessageBox("收缩压不能为0!");
                msgBox.ShowDialog();
                return;
            }
            if (double.Parse(txtQ6B.Text) <= 0)
            {
                var msgBox = new CustomMessageBox("舒张压不能为0!");
                msgBox.ShowDialog();
                return;
            }
            if (double.Parse(txtQ6B.Text) > double.Parse(txtQ6A.Text))
            {
                var msgBox = new CustomMessageBox("舒张压不能大于收缩压!");
                msgBox.ShowDialog();
                return;
            }
            if (double.Parse(txtQ7D.Text) <= 0)
            {
                var msgBox = new CustomMessageBox("血糖值不能为0!");
                msgBox.ShowDialog();
                return;
            }

            //保存答案
            //第六题
            M_QuestionnaireResultDetail question6 = new M_QuestionnaireResultDetail
            {
                QuestionResult       = (int)double.Parse(txtQ6A.Text) + "," + (int)double.Parse(txtQ6B.Text) + ",",
                QuestionCode         = QuestionnaireCode.Thah + ".6",
                PQuestionCode        = QuestionnaireCode.Thah + ".6",
                QuestionType         = 3,
                QuestionScore        = 0,
                PQuestionWeightScore = 0
            };

            ClientInfo.AddQuestionToQuestionnaire(question6, QuestionnaireCode.Thah);

            //第七题
            M_QuestionnaireResultDetail question7 = new M_QuestionnaireResultDetail
            {
                QuestionResult       = (rbQ7A.Checked ? "A," : (rbQ7B.Checked ? "B," : "C,")) + Math.Round(double.Parse(txtQ7D.Text), 1) + ",",
                QuestionCode         = QuestionnaireCode.Thah + ".7",
                PQuestionCode        = QuestionnaireCode.Thah + ".7",
                QuestionType         = 1,
                QuestionScore        = 0,
                PQuestionWeightScore = 0
            };

            ClientInfo.AddQuestionToQuestionnaire(question7, QuestionnaireCode.Thah);

            //跳转
            var thahFour = new ThahFour {
                TopMost = false
            };

            thahFour.Show();
            Close();
        }