public ActionResult TeacherEdit(int id) { //if (!User.Identity.IsAuthenticated) //{ // return Redirect("/Login/Login/Index"); //} DALT_Base_Teacher db = new DALT_Base_Teacher(); T_Base_Teacher teacher = db.GetTeacher(id); ViewBag.item = teacher; if (teacher == null) { return(Content("资料不存在!")); } return(View()); }
public void Reset(int id) { DALT_Base_Teacher db = new DALT_Base_Teacher(); T_Base_Teacher teacher = db.GetTeacher(id); string pwd = MD5Class.UserMd5(teacher.TeaId); teacher.PassWord = pwd; bool res = db.Update(teacher); if (res) { string tmp = "{\"statusCode\":\"200\",\"message\":\"重置密码成功\",\"navTabId\":\"teacherList\",\"rel\":\"teacherList\",\"callbackType\":\"\",\"forwardUrl\":\"\"}"; Response.Write(tmp); } else { string tmp = "{\"statusCode\":\"300\",\"message\":\"重置密码失败\",\"navTabId\":\"teacherList\",\"rel\":\"teacherList\",\"callbackType\":\"\",\"forwardUrl\":\"\"}"; Response.Write(tmp); } }
public void EditSave(T_Base_Teacher teacher) { DALT_Base_Teacher db = new DALT_Base_Teacher(); T_Base_Teacher teacher2 = db.GetTeacher(teacher.Id); teacher.PassWord = teacher2.PassWord; bool res = db.Update(teacher); if (res) { string tmp = "{\"statusCode\":\"200\",\"message\":\"修改成功\",\"navTabId\":\"TeacherList\",\"rel\":\"TeacherList\",\"callbackType\":\"closeCurrent\",\"forwardUrl\":\"\"}"; Response.Write(tmp); } else { string tmp = "{\"statusCode\":\"300\",\"message\":\"修改失败\",\"navTabId\":\"TeacherList\",\"rel\":\"TeacherList\",\"callbackType\":\"closeCurrent\",\"forwardUrl\":\"\"}"; Response.Write(tmp); } }