Ejemplo n.º 1
0
        //保存
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("_ybd_answer_record", EnumCollection.ActionEnum.Modify.ToString()); //检查权限
            BLL.answer_record   bll   = new BLL.answer_record();
            Model.answer_record model = bll.GetModel(this.id);

            model.group_id = Convert.ToInt32(txtgroup_id.Text);
            model.user_id  = Convert.ToInt32(txtuser_id.Text);
            model.exa_id   = Convert.ToInt32(txtexa_id.Text);
            model.q_id     = Convert.ToInt32(txtq_id.Text);
            model.answer   = Convert.ToString(txtanswer.Text);
            model.is_truth = Convert.ToInt32(txtis_truth.Text);
            model.score    = Convert.ToInt32(txtscore.Text);
            model.add_time = Convert.ToDateTime(txtadd_time.Text);

            if (bll.Update(model))
            {
                AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改答题记录信息,主键:" + id); //记录日志
                JscriptMsg("修改答题记录信息成功!", "Manage.aspx");
            }
            else
            {
                JscriptMsg("保存过程中发生错误!", "");
            }
        }
Ejemplo n.º 2
0
        private void SetAnswerIsTruth()
        {
            int id    = RequestHelper.GetFormInt("id");
            int score = RequestHelper.GetFormInt("score");

            BLL.answer_record   bll   = new BLL.answer_record();
            Model.answer_record model = bll.GetModel(id);
            if (model != null)
            {
                if (model.is_truth == (int)EnumCollection.YesOrNot.是)
                {
                    model.is_truth = (int)EnumCollection.YesOrNot.否;
                }
                else if (model.is_truth == (int)EnumCollection.YesOrNot.否)
                {
                    model.is_truth = (int)EnumCollection.YesOrNot.是;
                }
                else
                {
                    score = 0;
                }

                model.score = score;
                bll.Update(model);

                SumScore(model.exa_id, model.user_id);
            }
        }
Ejemplo n.º 3
0
        private void SetAnswerScore()
        {
            int id    = RequestHelper.GetFormInt("id");
            int score = RequestHelper.GetFormInt("score");

            BLL.answer_record   bll   = new BLL.answer_record();
            Model.answer_record model = bll.GetModel(id);
            if (model != null)
            {
                model.score = score;
                bll.Update(model);
            }
        }
Ejemplo n.º 4
0
 private void BindInfo()
 {
     BLL.answer_record   bll   = new BLL.answer_record();
     Model.answer_record model = bll.GetModel(this.id);
     if (model == null)
     {
         JscriptMsg("信息不存在或已被删除!", "back");
         return;
     }
     txtgroup_id.Text = model.group_id + "";
     txtuser_id.Text  = model.user_id + "";
     txtexa_id.Text   = model.exa_id + "";
     txtq_id.Text     = model.q_id + "";
     txtanswer.Text   = model.answer + "";
     txtis_truth.Text = model.is_truth + "";
     txtscore.Text    = model.score + "";
     txtadd_time.Text = model.add_time + "";
 }