public ActionResult StudentEdit(int id) { //if (!User.Identity.IsAuthenticated) //{ // return Redirect("/Login/Login/Index"); //} DALT_Base_Student db = new DALT_Base_Student(); T_Base_Student student = db.GetStudent(id); ViewBag.item = student; if (student == null) { return(Content("资料不存在!")); } return(View()); }
public void Reset(int id) { DALT_Base_Student db = new DALT_Base_Student(); T_Base_Student student = db.GetStudent(id); string pwd = MD5Class.UserMd5(student.StuId); student.PassWord = pwd; bool res = db.Update(student); if (res) { string tmp = "{\"statusCode\":\"200\",\"message\":\"重置密码成功\",\"navTabId\":\"StudentList\",\"rel\":\"StudentList\",\"callbackType\":\"\",\"forwardUrl\":\"\"}"; Response.Write(tmp); } else { string tmp = "{\"statusCode\":\"300\",\"message\":\"重置密码失败\",\"navTabId\":\"StudentList\",\"rel\":\"StudentList\",\"callbackType\":\"\",\"forwardUrl\":\"\"}"; Response.Write(tmp); } }
public void EditSave(T_Base_Student student) { DALT_Base_Student db = new DALT_Base_Student(); T_Base_Student student2 = db.GetStudent(student.Id); student.PassWord = student2.PassWord; student.ClassId = Convert.ToInt32(Request.Form["Class.Id"]); bool res = db.Update(student); if (res) { string tmp = "{\"statusCode\":\"200\",\"message\":\"修改成功\",\"navTabId\":\"StudentList\",\"rel\":\"StudentList\",\"callbackType\":\"closeCurrent\",\"forwardUrl\":\"\"}"; Response.Write(tmp); } else { string tmp = "{\"statusCode\":\"300\",\"message\":\"修改失败\",\"navTabId\":\"StudentList\",\"rel\":\"StudentList\",\"callbackType\":\"closeCurrent\",\"forwardUrl\":\"\"}"; Response.Write(tmp); } }