// 管理员删除学生 public ActionResult AdminDeleteStudent(string studentID) { 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; Student student = roleInfoService.SelectStudent(studentID); string studentdepartement = student.student_department; if (login.username == "123456") { string result = roleInfoService.AdminDeleteStudent(studentID); Response.Write("<script>alert('删除成功!');</script>"); return(View("AdminAlterStudentInfo")); } else { if (departement.Equals(studentdepartement)) { string result = roleInfoService.AdminDeleteStudent(studentID); Response.Write("<script>alert('删除成功!');</script>"); return(View("AdminAlterStudentInfo")); } else { Response.Write("<script>alert('您没有权限对其他学院信息进行更改操作!');</script>"); return(View("AdminAlterStudentInfo")); } } }
// 管理员删除学生 public ActionResult AdminDeleteStudent(string studentID) { string result = roleInfoService.AdminDeleteStudent(studentID); return(View("AdminAlterStudentInfo")); }