Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string RightWrong = "False";

            if (cboCourse.SelectedValue == null || txtTitle.Text == "")
            {
                MessageBox.Show("请输入完整的题目信息!");
            }
            else if (rdoRight.Checked == false && rdoWrong.Checked == false)
            {
                MessageBox.Show("请选择正确答案!");
            }
            else
            {
                if (rdoRight.Checked == true)
                {
                    RightWrong = "True";
                }
                try
                {
                    JudgeQuestionProblem jqp = new JudgeQuestionProblem(cboCourse.SelectedValue.ToString(), txtTitle.Text, RightWrong);
                    QuestionBll.AddjudgeProblem(jqp);
                    MessageBox.Show("添加成功!");
                    this.Close();
                }
                catch (Exception ee)
                {
                    MessageBox.Show("添加失败!" + ee);
                    throw;
                }
            }
        }