protected void BTNCounsellorLevelUpdate_Click(object sender, EventArgs e)
    {
        //等级提升按钮
        long lCounsellorID = long.Parse(Session["UsersID"].ToString());
        QuestionInfoBusiness questionInfoBusiness = new QuestionInfoBusiness();
        QuestionInfoEntity   questionInfoEntity   = new QuestionInfoEntity();

        questionInfoEntity = questionInfoBusiness.GETQuestionInfoByID(iQuestionID);

        if (questionInfoEntity.ccorrectAnswer == char.Parse(DDLQuestionSelection.SelectedValue))
        {
            Response.Write("<script>alert('回答正确!')</script>");
            CounsellorInfoBusiness CounsellorLevelUpdate = new CounsellorInfoBusiness();
            CounsellorLevelUpdate.CounsellorLevelUpdate(lCounsellorID);
            //律师等级+1
        }
        else
        {
            Response.Write("<script>alert('回答错误!')</script>");
        }
    }
    private void QuestionInfoDisplay(int iQuestionLevel)
    {
        string sQuestionFieldRandom = QuestionFieldRandom();
        QuestionInfoBusiness questionInfoBusiness = new QuestionInfoBusiness();
        QuestionInfoEntity   questionInfoEntity   = new QuestionInfoEntity();

        if (iQuestionLevel > 2)
        {
            LBLQuestionLevelInfo.Visible      = false;
            LBLQuestionTitleInfo.Visible      = false;
            LBLQuestionLevel.Visible          = false;
            LBLQuestionTitle.Text             = "您已得到最高级别";
            LBLQuestionSelectionAInfo.Visible = false;
            LBLQuestionSelectionA.Visible     = false;
            LBLQuestionSelectionBInfo.Visible = false;
            LBLQuestionSelectionB.Visible     = false;
            LBLQuestionSelectionCInfo.Visible = false;
            LBLQuestionSelectionC.Visible     = false;
            LBLQuestionSelectionDInfo.Visible = false;
            LBLQuestionSelectionD.Visible     = false;
            BTNCounsellorInfoUpdate.Visible   = false;
            DDLQuestionSelection.Visible      = false;
            BTNCounsellorLevelUpdate.Visible  = false;
        }
        else
        {
            iQuestionID                = questionInfoBusiness.RandomQuestionID(sQuestionFieldRandom, iQuestionLevel + 1);
            questionInfoEntity         = questionInfoBusiness.GETQuestionInfoByID(iQuestionID);
            LBLQuestionLevel.Text      = questionInfoEntity.iquestionLevel.ToString();
            LBLQuestionTitle.Text      = questionInfoEntity.squestionTitle;
            LBLQuestionSelectionA.Text = questionInfoEntity.squestionSelectionA;
            LBLQuestionSelectionB.Text = questionInfoEntity.squestionSelectionB;
            LBLQuestionSelectionC.Text = questionInfoEntity.squestionSelectionC;
            LBLQuestionSelectionD.Text = questionInfoEntity.squestionSelectionD;
        }
    }
Example #3
0
    private void AddQuestionInfo()
    {
        QuestionInfoBusiness AddQuestion    = new QuestionInfoBusiness();
        QuestionInfoEntity   QuestionDetail = new QuestionInfoEntity();

        QuestionDetail.squestionField      = DDLQuestionFieldsSelecting.SelectedItem.Text;
        QuestionDetail.squestionTitle      = TBQuestionTitle.Text;
        QuestionDetail.squestionSelectionA = TBAnswerA.Text;
        QuestionDetail.squestionSelectionB = TBAnwserB.Text;
        QuestionDetail.squestionSelectionC = TBAnswerC.Text;
        QuestionDetail.squestionSelectionD = TBAnswerD.Text;
        QuestionDetail.ccorrectAnswer      = char.Parse(DDLCorrectAnswer.SelectedItem.Text);
        QuestionDetail.iquestionLevel      = int.Parse(DDLQuestionLevel.SelectedItem.Text);
        int iResultJudgement = AddQuestion.QuestionInfoAdd(QuestionDetail);

        if (iResultJudgement > 0)
        {
            Response.Write("<script>alert('已成功加入问题!')</script>");
        }
        else
        {
            Response.Write("<script>alert('问题加入失败!')</script>");
        }
    }