Ejemplo n.º 1
0
 private void ShowInfo(string id)
 {
     Topicsys.BLL.t_topic   bll   = new Topicsys.BLL.t_topic();
     Topicsys.Model.t_topic model = bll.GetModel(id);
     this.txtstudent_class_id.Text = model.topic_class_id;
     this.txttopic_name.Text       = model.topic_name;
     this.txttopic_note.Text       = model.topic_note;
     this.ddlStat.Text             = model.topic_stat.ToString();
     this.txttopic_num.Text        = model.topic_num.ToString();
 }
Ejemplo n.º 2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txttopic_name.Text.Trim().Length == 0)
            {
                strErr += "论文题目不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txttopic_num.Text))
            {
                strErr += "可选人数格式错误!\\n";
            }

            if (strErr != "")
            {
                BLL.Utils.ShowMessage(this, strErr);
                return;
            }

            string topic_class_id = this.txtstudent_class_id.Text;
            string topic_name     = this.txttopic_name.Text;
            string topic_note     = this.txttopic_note.Text;
            int    topic_stat     = int.Parse(this.ddlStat.Text);

            /// 判断是否为违规操作
            if (topic_stat != 0 && topic_stat != 9)
            {
                BLL.Utils.ShowMessage(this, "请勿尝试注入!您已被注销!");
                BLL.Utils.Log(this, "非法修改出题状态!题目UUID:" + Request.Params["topic_id"]);
                Response.End();
            }
            int topic_num = int.Parse(this.txttopic_num.Text);

            Topicsys.BLL.t_topic   bll   = new Topicsys.BLL.t_topic();
            Topicsys.Model.t_topic model = bll.GetModel(Request.Params["topic_id"]);
            model.topic_class_id = topic_class_id;
            model.topic_name     = topic_name;
            model.topic_note     = topic_note;
            model.topic_stat     = topic_stat;
            model.topic_num      = topic_num;


            /// 写入日志
            BLL.Utils.Log(this, "修改出题:" + model.topic_id);
            BLL.Utils.ShowMessage(this, bll.Update(model)? "保存成功!":"发生错误!");
        }
Ejemplo n.º 3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtstudent_class_id.Text.Trim().Length == 0)
            {
                strErr += "可选班级不能为空!\\n";
            }
            if (this.txttopic_name.Text.Trim().Length == 0)
            {
                strErr += "论文题目不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txttopic_num.Text))
            {
                strErr += "可选人数上限格式错误!\\n";
            }

            if (strErr != "")
            {
                BLL.Utils.ShowMessage(this, strErr);
                return;
            }
            string topic_teacher_gh = Session["login_name"].ToString();
            string topic_name       = this.txttopic_name.Text;
            string topic_note       = this.txttopic_note.Text;
            int    topic_num        = int.Parse(this.txttopic_num.Text);

            if (topic_num > 200)
            {
                BLL.Utils.ShowMessage(this, "可选人数上限超过200!");
            }
            Topicsys.Model.t_topic model = new Topicsys.Model.t_topic();
            model.topic_teacher_gh = topic_teacher_gh;
            model.topic_name       = topic_name;
            model.topic_note       = topic_note;
            model.topic_num        = topic_num;
            model.topic_class_id   = txtstudent_class_id.SelectedValue;

            Topicsys.BLL.t_topic bll = new Topicsys.BLL.t_topic();
            /// 写入日志
            BLL.Utils.Log(this, "添加出题:" + topic_name);
            BLL.Utils.ShowMessage(this, bll.Add(model));
        }