Ejemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (cboCourse.SelectedValue == null || txtFrontTitle.Text == "" || txtbackTitle.Text == "")
     {
         MessageBox.Show("请输入完整的题目信息!");
     }
     else if (txtAnswer.Text == "")
     {
         MessageBox.Show("请输入正确答案!");
     }
     else
     {
         try
         {
             fillBlankProblem fbp = new fillBlankProblem(cboCourse.SelectedValue.ToString(), txtFrontTitle.Text, txtbackTitle.Text, txtAnswer.Text);
             QuestionBll.AddfillBlankProblem(fbp);
             MessageBox.Show("添加成功!");
             this.Close();
         }
         catch (Exception ee)
         {
             MessageBox.Show("添加失败!" + ee);
             throw;
         }
     }
 }