Ejemplo n.º 1
0
 private void ShowInfo(int id)
 {
     BLL.DDL.DeptDLL(ddlDept_id);
     BLL.DDL.MajorDLL(ddlMajor_id);
     Topicsys.BLL.t_student   bll   = new Topicsys.BLL.t_student();
     Topicsys.Model.t_student model = bll.GetModel(id);
     this.txtstudent_xh.Text       = model.student_xh;
     this.txtstudent_name.Text     = model.student_name;
     this.txtstudent_class_id.Text = model.student_class_id;
     this.ddlStat.Text             = model.student_stat.ToString();
     this.txtstudent_note.Text     = model.student_note;
 }
Ejemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtstudent_xh.Text.Trim().Length == 0)
            {
                strErr += "学号不能为空!\\n";
            }
            if (this.txtstudent_name.Text.Trim().Length == 0)
            {
                strErr += "姓名不能为空!\\n";
            }
            if (this.txtstudent_class_id.Text.Trim().Length == 0)
            {
                strErr += "班级不能为空!\\n";
            }

            if (strErr != "")
            {
                BLL.Utils.ShowMessage(this, strErr);
                return;
            }
            string student_xh       = this.txtstudent_xh.Text;
            string student_name     = this.txtstudent_name.Text;
            string student_class_id = this.txtstudent_class_id.Text;
            string pwd = this.txtpwd.Text.Trim();

            if (pwd.Length < 6)
            {
                BLL.Utils.ShowMessage(this, "密码长度应该大于等于6个字符!");
                return;
            }
            Topicsys.Model.t_student model = new Topicsys.Model.t_student();
            model.student_xh       = student_xh;
            model.student_pwd      = BLL.Utils.HashPasswd(pwd);
            model.student_name     = student_name;
            model.student_class_id = student_class_id;

            /// 写入日志

            BLL.Utils.Log(new Model.t_log
            {
                log_info  = "学生注册:" + student_xh,
                log_ip    = Request.UserHostAddress,
                user_name = student_xh
            });
            Topicsys.BLL.t_student bll = new Topicsys.BLL.t_student();
            BLL.Utils.ShowMessage(this, bll.Add(model));
        }
Ejemplo n.º 3
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtstudent_xh.Text.Trim().Length == 0)
            {
                strErr += "学号不能为空!\\n";
            }
            if (this.txtstudent_name.Text.Trim().Length == 0)
            {
                strErr += "姓名不能为空!\\n";
            }
            if (this.txtstudent_class_id.Text.Trim().Length == 0)
            {
                strErr += "班级不能为空!\\n";
            }

            if (strErr != "")
            {
                BLL.Utils.ShowMessage(this, strErr);
                return;
            }
            string student_xh       = this.txtstudent_xh.Text;
            string student_name     = this.txtstudent_name.Text;
            string student_class_id = this.txtstudent_class_id.Text;
            int    student_stat     = int.Parse(this.ddlStat.Text);
            string student_note     = this.txtstudent_note.Text;

            Topicsys.BLL.t_student bll = new Topicsys.BLL.t_student();

            var model = bll.GetModel(int.Parse(Request.Params["id"]));

            model.student_xh       = student_xh;
            model.student_name     = student_name;
            model.student_class_id = student_class_id;
            model.student_stat     = student_stat;
            model.student_note     = student_note;

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

            if (this.txtstudent_xh.Text.Trim().Length == 0)
            {
                strErr += "学号不能为空!\\n";
            }
            if (this.txtstudent_name.Text.Trim().Length == 0)
            {
                strErr += "姓名不能为空!\\n";
            }
            if (this.txtstudent_class_id.Text.Trim().Length == 0)
            {
                strErr += "班级不能为空!\\n";
            }

            if (strErr != "")
            {
                BLL.Utils.ShowMessage(this, strErr);
                return;
            }
            string student_xh       = this.txtstudent_xh.Text;
            string student_name     = this.txtstudent_name.Text;
            string student_class_id = this.txtstudent_class_id.Text;
            string student_note     = this.txtstudent_note.Text;

            Topicsys.Model.t_student model = new Topicsys.Model.t_student();
            model.student_xh       = student_xh;
            model.student_pwd      = BLL.Utils.HashPasswd("abc12345");
            model.student_name     = student_name;
            model.student_class_id = student_class_id;
            model.student_note     = student_note;

            Topicsys.BLL.t_student bll = new Topicsys.BLL.t_student();

            /// 写入日志
            BLL.Utils.Log(this, "添加学生:" + student_xh);
            BLL.Utils.ShowMessage(this, bll.Add(model));
        }