public ActionResult ChangeSelfInfo() { Login login = (Login)Session["loginInfo"]; if (login == null) { //未登录 //跳转到登录页面 Session["prePage"] = "/Teacher/TeacherManager";//将当前页面地址放入session,登录后返回到该页面 return(RedirectToAction("Index", "Login")); } string username = login.username; //string username = "******"; Teacher teacher = roleInfoService.SelectTeacherByID(username); ViewData["teacher_id"] = teacher.teacher_id; ViewData["teacherName"] = teacher.teacher_name; ViewData["teacherSex"] = teacher.teachert_sex; ViewData["teacherIDCard"] = teacher.teacher_id_card; ViewData["teacherAge"] = Convert.ToInt32(teacher.teachert_age); ViewData["teacherDepartment"] = teacher.teacher_department; ViewData["teacherTitle"] = teacher.teacher_title; ViewData["teacherNative"] = teacher.teacher_native; ViewData["teacherBirthplace"] = teacher.teacher_birthplace; ViewData["teacherPoliticsstatus"] = teacher.teacher_politicsstatus; ViewData["teacherTeachingtime"] = teacher.teacher_teachingtime; ViewData["teacherContact"] = teacher.teacher_contact; ViewData["teacherOther"] = teacher.teacher_other; ViewData["teacherStatus"] = Convert.ToInt32(teacher.status); return(View()); }
public ActionResult AdminUpdateTeacherInfo(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; ViewData["teacher_id"] = teacher.teacher_id; ViewData["teacher_name"] = teacher.teacher_name; ViewData["teachert_sex"] = teacher.teachert_sex; ViewData["teacher_id_card"] = teacher.teacher_id_card; ViewData["teachert_age"] = teacher.teachert_age; ViewData["teacher_department"] = teacher.teacher_department; ViewData["teacher_title"] = teacher.teacher_title; ViewData["teacher_native"] = teacher.teacher_native; ViewData["teacher_birthplace"] = teacher.teacher_birthplace; ViewData["teacher_photo"] = teacher.teacher_photo; ViewData["teacher_politicsstatus"] = teacher.teacher_politicsstatus; ViewData["teacher_teachingtime"] = teacher.teacher_teachingtime; ViewData["teacher_contact"] = teacher.teacher_contact; ViewData["teacher_other"] = teacher.teacher_other; ViewData["status"] = teacher.status; if (login.username == "123456") { return(View()); } else { if (departement.Equals(teaacherdepartement)) { return(View()); } else { Response.Write("<script>alert('您没有权限对其他学院信息进行更改操作!');</script>"); return(View("AdminAlterTeacherInfo")); } } }
public ActionResult AdminUpdateTeacherInfo(string teacherID) { Teacher teacher = roleInfoService.SelectTeacherByID(teacherID); ViewData["teacher_id"] = teacher.teacher_id; ViewData["teacher_name"] = teacher.teacher_name; ViewData["teachert_sex"] = teacher.teachert_sex; ViewData["teacher_id_card"] = teacher.teacher_id_card; ViewData["teachert_age"] = teacher.teachert_age; ViewData["teacher_department"] = teacher.teacher_department; ViewData["teacher_title"] = teacher.teacher_title; ViewData["teacher_native"] = teacher.teacher_native; ViewData["teacher_birthplace"] = teacher.teacher_birthplace; ViewData["teacher_photo"] = teacher.teacher_photo; ViewData["teacher_politicsstatus"] = teacher.teacher_politicsstatus; ViewData["teacher_teachingtime"] = teacher.teacher_teachingtime; ViewData["teacher_contact"] = teacher.teacher_contact; ViewData["teacher_other"] = teacher.teacher_other; ViewData["status"] = teacher.status; return(View()); }