/*更新修改ScoreInfo信息*/ public String ModifyScoreInfo() { ActionContext ctx = ActionContext.getContext(); try { if (true) { Student_QQ287307421DAO student_QQ287307421DAO = new Student_QQ287307421DAO(); Student_QQ287307421 studentNumber = student_QQ287307421DAO.GetStudent_QQ287307421ByStudentNumber( scoreInfo.getStudentNumber().getStudentNumber()); scoreInfo.setStudentNumber(studentNumber); } if (true) { CourseInfo_QQ254540457DAO courseInfo_QQ254540457DAO = new CourseInfo_QQ254540457DAO(); CourseInfo_QQ254540457 courseNumber = courseInfo_QQ254540457DAO.GetCourseInfo_QQ254540457ByCourseNumber( scoreInfo.getCourseNumber().getCourseNumber()); scoreInfo.setCourseNumber(courseNumber); } scoreInfoDAO.UpdateScoreInfo(scoreInfo); ctx.put("message", java.net.URLEncoder.encode("ScoreInfo信息更新成功!")); return "modify_success"; } catch (Exception e) { e.printStackTrace(); ctx.put("error", java.net.URLEncoder.encode("ScoreInfo信息更新失败!")); return "error"; } }
/*添加ScoreInfo信息*/ @SuppressWarnings("deprecation") public String AddScoreInfo() { ActionContext ctx = ActionContext.getContext(); try { if (true) { Student_QQ287307421DAO student_QQ287307421DAO = new Student_QQ287307421DAO(); Student_QQ287307421 studentNumber = student_QQ287307421DAO.GetStudent_QQ287307421ByStudentNumber( scoreInfo.getStudentNumber().getStudentNumber()); scoreInfo.setStudentNumber(studentNumber); } if (true) { CourseInfo_QQ254540457DAO courseInfo_QQ254540457DAO = new CourseInfo_QQ254540457DAO(); CourseInfo_QQ254540457 courseNumber = courseInfo_QQ254540457DAO.GetCourseInfo_QQ254540457ByCourseNumber( scoreInfo.getCourseNumber().getCourseNumber()); scoreInfo.setCourseNumber(courseNumber); } scoreInfoDAO.AddScoreInfo(scoreInfo); ctx.put("message", java.net.URLEncoder.encode("ScoreInfo添加成功!")); return "add_success"; } catch (Exception e) { e.printStackTrace(); ctx.put("error", java.net.URLEncoder.encode("ScoreInfo添加失败!")); return "error"; } }
/*前台查询ScoreInfo信息*/ public String FrontQueryScoreInfo() { if (currentPage == 0) currentPage = 1; List<ScoreInfo> scoreInfoList = scoreInfoDAO.QueryScoreInfoInfo(studentNumber, courseNumber, currentPage); /*计算总的页数和总的记录数*/ scoreInfoDAO.CalculateTotalPageAndRecordNumber(studentNumber, courseNumber); /*获取到总的页码数目*/ totalPage = scoreInfoDAO.getTotalPage(); /*当前查询条件下总记录数*/ recordNumber = scoreInfoDAO.getRecordNumber(); ActionContext ctx = ActionContext.getContext(); ctx.put("scoreInfoList", scoreInfoList); ctx.put("totalPage", totalPage); ctx.put("recordNumber", recordNumber); ctx.put("currentPage", currentPage); ctx.put("studentNumber", studentNumber); Student_QQ287307421DAO student_QQ287307421DAO = new Student_QQ287307421DAO(); List<Student_QQ287307421> student_QQ287307421List = student_QQ287307421DAO.QueryAllStudent_QQ287307421Info(); ctx.put("student_QQ287307421List", student_QQ287307421List); ctx.put("courseNumber", courseNumber); CourseInfo_QQ254540457DAO courseInfo_QQ254540457DAO = new CourseInfo_QQ254540457DAO(); List<CourseInfo_QQ254540457> courseInfo_QQ254540457List = courseInfo_QQ254540457DAO.QueryAllCourseInfo_QQ254540457Info(); ctx.put("courseInfo_QQ254540457List", courseInfo_QQ254540457List); return "front_query_view"; }
/*跳转到添加ScoreInfo视图*/ public String AddView() { ActionContext ctx = ActionContext.getContext(); /*查询所有的Student_QQ287307421信息*/ Student_QQ287307421DAO student_QQ287307421DAO = new Student_QQ287307421DAO(); List<Student_QQ287307421> student_QQ287307421List = student_QQ287307421DAO.QueryAllStudent_QQ287307421Info(); ctx.put("student_QQ287307421List", student_QQ287307421List); /*查询所有的CourseInfo_QQ254540457信息*/ CourseInfo_QQ254540457DAO courseInfo_QQ254540457DAO = new CourseInfo_QQ254540457DAO(); List<CourseInfo_QQ254540457> courseInfo_QQ254540457List = courseInfo_QQ254540457DAO.QueryAllCourseInfo_QQ254540457Info(); ctx.put("courseInfo_QQ254540457List", courseInfo_QQ254540457List); return "add_view"; }
/*查询要修改的ScoreInfo信息*/ public String FrontShowScoreInfoQuery() { ActionContext ctx = ActionContext.getContext(); /*根据主键scoreId获取ScoreInfo对象*/ ScoreInfo scoreInfo = scoreInfoDAO.GetScoreInfoByScoreId(scoreId); Student_QQ287307421DAO student_QQ287307421DAO = new Student_QQ287307421DAO(); List<Student_QQ287307421> student_QQ287307421List = student_QQ287307421DAO.QueryAllStudent_QQ287307421Info(); ctx.put("student_QQ287307421List", student_QQ287307421List); CourseInfo_QQ254540457DAO courseInfo_QQ254540457DAO = new CourseInfo_QQ254540457DAO(); List<CourseInfo_QQ254540457> courseInfo_QQ254540457List = courseInfo_QQ254540457DAO.QueryAllCourseInfo_QQ254540457Info(); ctx.put("courseInfo_QQ254540457List", courseInfo_QQ254540457List); ctx.put("scoreInfo", scoreInfo); return "front_show_view"; }