Beispiel #1
0
        private void btnBefore_Click(object sender, EventArgs e)
        {
            //停止播放
            if (wmPlayerForm != null)
            {
                wmPlayerForm.Stop();
            }
            QuestionFive frmBefore = new QuestionFive();

            frmBefore.TopMost = false;
            frmBefore.Show();
            this.Close();
        }
Beispiel #2
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            //停止播放
            if (wmPlayerForm != null)
            {
                wmPlayerForm.Stop();
            }

            string strResult = "";

            if (chkA.Checked)
            {
                strResult += "A,";
            }

            if (chkB.Checked)
            {
                strResult += "B,";
            }

            if (chkC.Checked)
            {
                strResult += "C,";
            }

            M_QuestionnaireResultDetail question1 = new M_QuestionnaireResultDetail();

            question1.QuestionResult = strResult;

            question1.QuestionCode  = QuestionnaireCode.NaoNianChiDai + ".4.C";
            question1.QuestionType  = 2;
            question1.PQuestionCode = QuestionnaireCode.NaoNianChiDai + ".4";
            //打分,共3分,权重2.0
            int tempScore = 0;

            if (strResult.Contains("A"))
            {
                tempScore += 1;
            }
            if (strResult.Contains("B"))
            {
                tempScore += 1;
            }
            if (strResult.Contains("C"))
            {
                tempScore += 1;
            }

            question1.QuestionScore        = tempScore;//tempScore*2;
            question1.PQuestionWeightScore = tempScore * 2;

            ClientInfo.AddQuestionToQuestionnaire(question1, QuestionnaireCode.NaoNianChiDai);

            //更新第四大题权重分
            //如果已登录
            if (LoginInfo.GetInstance().UserId > 0)
            {
                M_QuestionnaireUserDetail questionnaireUserDetail = ClientInfo.GetQuestionnaireByCode(QuestionnaireCode.NaoNianChiDai);
                var results = screenWebapiClient.GetQuestionnaireResultDetails(questionnaireUserDetail.QuestionnaireRecodId);
                if (results != null && results.Any())
                {
                    decimal tempWeightScore = 0;
                    decimal score           = 0;
                    foreach (var item in results)
                    {
                        if (item.QuestionCode.Contains("301AD.4"))
                        {
                            score += item.QuestionScore;
                        }
                    }
                    tempWeightScore = score * 2;
                    foreach (var item in results)
                    {
                        if (item.QuestionCode.Contains("301AD.4"))
                        {
                            screenWebapiClient.UpdateQuestionnaireResultWeightScore(tempWeightScore, item.QuestionnaireResultDetailId);
                        }
                    }
                    //MessageBox.Show(tempWeightScore.ToString());
                }
            }

            QuestionFive five = new QuestionFive();

            five.TopMost = false;
            //five.Show();
            five.Show();
            this.Close();
        }