示例#1
0
        //上一页
        private void btnBefore_Click(object sender, EventArgs e)
        {
            var thahThree = new ThahThree {
                TopMost = false
            };

            thahThree.Show();
            Close();
        }
示例#2
0
        //下一页
        private void btnNext_Click(object sender, EventArgs e)
        {
            //判断
            if (string.IsNullOrEmpty(txtQ3.Text) || string.IsNullOrEmpty(txtQ4.Text) || string.IsNullOrEmpty(txtQ5.Text))
            {
                var msgBox = new CustomMessageBox("请答完本页所有题目再进入下一题!");
                msgBox.ShowDialog();
                return;
            }
            if (double.Parse(txtQ3.Text) <= 0)
            {
                var msgBox = new CustomMessageBox("身高不能为零!");
                msgBox.ShowDialog();
                return;
            }
            if (double.Parse(txtQ4.Text) <= 0)
            {
                var msgBox = new CustomMessageBox("体重不能为零!");
                msgBox.ShowDialog();
                return;
            }
            if (double.Parse(txtQ5.Text) <= 0)
            {
                var msgBox = new CustomMessageBox("BMI指数不能为零!");
                msgBox.ShowDialog();
                return;
            }

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

            ClientInfo.AddQuestionToQuestionnaire(question3, QuestionnaireCode.Thah);

            //第四题
            M_QuestionnaireResultDetail question4 = new M_QuestionnaireResultDetail
            {
                QuestionResult       = Math.Round(double.Parse(txtQ4.Text), 1) + ",",
                QuestionCode         = QuestionnaireCode.Thah + ".4",
                PQuestionCode        = QuestionnaireCode.Thah + ".4",
                QuestionType         = 3,
                QuestionScore        = 0,
                PQuestionWeightScore = 0
            };

            ClientInfo.AddQuestionToQuestionnaire(question4, QuestionnaireCode.Thah);

            //第五题
            M_QuestionnaireResultDetail question5 = new M_QuestionnaireResultDetail
            {
                QuestionResult       = Math.Round(double.Parse(txtQ5.Text), 1) + ",",
                QuestionCode         = QuestionnaireCode.Thah + ".5",
                PQuestionCode        = QuestionnaireCode.Thah + ".5",
                QuestionType         = 3,
                QuestionScore        = 0,
                PQuestionWeightScore = 0
            };

            ClientInfo.AddQuestionToQuestionnaire(question5, QuestionnaireCode.Thah);

            //跳转
            var thahThree = new ThahThree {
                TopMost = false
            };

            thahThree.Show();
            Close();
        }