Esempio n. 1
0
 private void tsbtnDel_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentCell != null)
     {
         if (MessageBox.Show("是否删除信息?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
         {
             try
             {
                 PaperBll.DelPaper(dataGridView1.CurrentRow.Cells[1].Value.ToString());
                 dataGridView1.DataSource = PaperBll.PaperFillDs().Tables[1];
                 getcolumn();
                 MessageBox.Show("删除成功!");
             }
             catch (Exception ee)
             {
                 MessageBox.Show("删除失败!" + ee);
                 throw;
             }
         }
     }
 }
Esempio n. 2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (ckbSingleProblem.Checked == false && ckbQuestionProblem.Checked == false && ckbMultiProblem.Checked != false && ckbJudgeProblem.Checked == false && ckbFillBlankProblem.Checked == false)
     {
         MessageBox.Show("请选择试题!");
     }
     else
     {
         if (PaperBll.GetPaper(txtPaperName.Text))
         {
             if (txtTime.Text == "")
             {
                 MessageBox.Show("请输入考试时间!");
             }
             else
             {
                 try
                 {
                     PaperBll.AddPaper(txtPaperName.Text, cboCourse.SelectedValue.ToString());
                     PaperDetailBll.PaperDetailAdd(pd);
                     PrintXPS();
                     MessageBox.Show("添加成功!");
                     this.Close();
                 }
                 catch (Exception ee)
                 {
                     MessageBox.Show("添加失败!" + ee);
                     throw;
                 }
             }
         }
         else
         {
             MessageBox.Show("试卷名已存在!");
         }
     }
 }
Esempio n. 3
0
 private void frmSelectPaper_Load(object sender, EventArgs e)
 {
     PaperBll.FillcboPaper(cboPaper);
 }
Esempio n. 4
0
 private void frmScoreManage_Load(object sender, EventArgs e)
 {
     dataGridView1.DataSource = ScoreBll.ScoreFillDs("").Tables[0];
     getcolumn();
     PaperBll.FillcboPaper(tscboPaper.ComboBox);
 }
Esempio n. 5
0
 private void frmPaperManage_Load(object sender, EventArgs e)
 {
     dataGridView1.DataSource = PaperBll.PaperFillDs().Tables[1];
     getcolumn();
 }
Esempio n. 6
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (txtTime.Text == "")
     {
         MessageBox.Show("请输入考试时间!");
     }
     else
     {
         if (ckbSingleProblem.Checked == true)
         {
             if (txtSingleMark.Text == "" || txtSingleCount.Text == "")
             {
                 MessageBox.Show("请输入单选题详细信息!");
             }
             else
             {
                 if (Convert.ToInt32(txtSingleCount.Text) < QuestionBll.singleCount(cboCourse.SelectedValue.ToString()))
                 {
                     List <int> count = num(QuestionBll.singleCount(cboCourse.SelectedValue.ToString()), Convert.ToInt32(txtSingleCount.Text));
                     for (int i = 0; i < Convert.ToInt32(txtSingleCount.Text); i++)
                     {
                         pd.Add(new PaperDetail(PaperBll.GetPaperID(txtPaperName.Text), "singleProblem", count[i], Convert.ToInt32(txtSingleMark.Text), Convert.ToInt32(txtTime.Text)));
                     }
                 }
                 else
                 {
                     MessageBox.Show("题库题目不足!");
                 }
             }
         }
         if (ckbMultiProblem.Checked == true)
         {
             if (txtMultiCount.Text == "" || txtMultiMark.Text == "")
             {
                 MessageBox.Show("请输入多选题详细信息!");
             }
             else
             {
                 if (Convert.ToInt32(txtMultiCount.Text) < QuestionBll.multiCount(cboCourse.SelectedValue.ToString()))
                 {
                     List <int> count = num(QuestionBll.multiCount(cboCourse.SelectedValue.ToString()), Convert.ToInt32(txtMultiCount.Text));
                     for (int i = 0; i < Convert.ToInt32(txtMultiCount.Text); i++)
                     {
                         pd.Add(new PaperDetail(PaperBll.GetPaperID(txtPaperName.Text), "multiProblem", count[i], Convert.ToInt32(txtMultiMark.Text), Convert.ToInt32(txtTime.Text)));
                     }
                 }
                 else
                 {
                     MessageBox.Show("题库题目不足!");
                 }
             }
         }
         if (ckbFillBlankProblem.Checked == true)
         {
             if (txtFillBlankCount.Text == "" || txtFillBlankMark.Text == "")
             {
                 MessageBox.Show("请输入填空题详细信息!");
             }
             else
             {
                 if (Convert.ToInt32(txtFillBlankCount.Text) < QuestionBll.fillBlankCount(cboCourse.SelectedValue.ToString()))
                 {
                     List <int> count = num(QuestionBll.fillBlankCount(cboCourse.SelectedValue.ToString()), Convert.ToInt32(txtFillBlankCount.Text));
                     for (int i = 0; i < Convert.ToInt32(txtSingleCount.Text); i++)
                     {
                         pd.Add(new PaperDetail(PaperBll.GetPaperID(txtPaperName.Text), "fillBlankProblem", count[i], Convert.ToInt32(txtFillBlankMark.Text), Convert.ToInt32(txtTime.Text)));
                     }
                 }
                 else
                 {
                     MessageBox.Show("题库题目不足!");
                 }
             }
         }
         if (ckbJudgeProblem.Checked == true)
         {
             if (txtJudgeCount.Text == "" || txtJudgeMark.Text == "")
             {
                 MessageBox.Show("请输入判断题详细信息!");
             }
             else
             {
                 if (Convert.ToInt32(txtJudgeCount.Text) < QuestionBll.judgeCount(cboCourse.SelectedValue.ToString()))
                 {
                     List <int> count = num(QuestionBll.judgeCount(cboCourse.SelectedValue.ToString()), Convert.ToInt32(txtJudgeCount.Text));
                     for (int i = 0; i < Convert.ToInt32(txtJudgeCount.Text); i++)
                     {
                         pd.Add(new PaperDetail(PaperBll.GetPaperID(txtPaperName.Text), "judgeProblem", count[i], Convert.ToInt32(txtJudgeMark.Text), Convert.ToInt32(txtTime.Text)));
                     }
                 }
                 else
                 {
                     MessageBox.Show("题库题目不足!");
                 }
             }
         }
         if (ckbQuestionProblem.Checked == true)
         {
             if (txtQuestionCount.Text == "" || txtQuestionMark.Text == "")
             {
                 MessageBox.Show("请输入简答题详细信息!");
             }
             else
             {
                 if (Convert.ToInt32(txtQuestionCount.Text) < QuestionBll.questionCount(cboCourse.SelectedValue.ToString()))
                 {
                     List <int> count = num(QuestionBll.questionCount(cboCourse.SelectedValue.ToString()), Convert.ToInt32(txtQuestionCount.Text));
                     for (int i = 0; i < Convert.ToInt32(txtQuestionCount.Text); i++)
                     {
                         pd.Add(new PaperDetail(PaperBll.GetPaperID(txtPaperName.Text), "questionProblem", count[i], Convert.ToInt32(txtQuestionMark.Text), Convert.ToInt32(txtTime.Text)));
                     }
                 }
                 else
                 {
                     MessageBox.Show("题库题目不足!");
                 }
             }
         }
         if (ckbSingleProblem.Checked == false && ckbQuestionProblem.Checked == false && ckbMultiProblem.Checked == false && ckbJudgeProblem.Checked == false && ckbFillBlankProblem.Checked == false)
         {
             MessageBox.Show("请选择试题!");
         }
         dataGridView1.DataSource = PaperDetailBll.PaperDetailFillDs(pd, "questionProblem").Tables[0];
         dataGridView2.DataSource = PaperDetailBll.PaperDetailFillDs(pd, "singleProblem").Tables[0];
         dataGridView3.DataSource = PaperDetailBll.PaperDetailFillDs(pd, "multiProblem").Tables[0];
         dataGridView4.DataSource = PaperDetailBll.PaperDetailFillDs(pd, "judgeProblem").Tables[0];
         dataGridView5.DataSource = PaperDetailBll.PaperDetailFillDs(pd, "fillBlankProblem").Tables[0];
     }
 }