// 管理员删除教师 public ActionResult AdminDeleteTeacher(string teacherID) { Login login = (Login)Session["loginInfo"]; if (login == null) { //未登录 //跳转到登录页面 Session["prePage"] = "/Admin/Index";//将当前页面地址放入session,登录后返回到该页面 return(RedirectToAction("Index", "Login")); } Administrator admin = roleInfoService.SelectAdministratorByID(login.username); string departement = admin.administrator_department; Teacher teacher = roleInfoService.SelectTeacherByID(teacherID); string teaacherdepartement = teacher.teacher_department; if (login.username == "123456") { string result = roleInfoService.AdminDeleteTeacher(teacherID); Response.Write("<script>alert('删除成功!');</script>"); return(View("AdminAlterTeacherInfo")); } else { if (departement.Equals(teaacherdepartement)) { string result = roleInfoService.AdminDeleteTeacher(teacherID); Response.Write("<script>alert('删除成功!');</script>"); return(View("AdminAlterTeacherInfo")); } else { Response.Write("<script>alert('您没有权限对其他学院信息进行更改操作!');</script>"); return(View("AdminAlterTeacherInfo")); } } }
// 管理员删除教师 public ActionResult AdminDeleteTeacher(string teacherID) { string result = roleInfoService.AdminDeleteTeacher(teacherID); return(View("AdminAlterTeacherInfo")); }