📄 modifystudentrscore.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: ModifyStudEntrScore.java
package com.saintbo.servlet.student;
import com.saintbo.entity.student.TblStudentEntrScore;
import com.saintbo.javabean.sys.UserInfo;
import com.saintbo.servlet.MyExtendedServlet;
import com.saintbo.session.student.StudentSessionLocal;
import com.saintbo.session.student.StudentSessionLocalHome;
import com.saintbo.util.upload.RequestHashtable;
import com.saintbo.util.upload.UploadRequest;
import java.io.IOException;
import javax.naming.InitialContext;
import javax.servlet.*;
import javax.servlet.http.HttpSession;
public class ModifyStudEntrScore extends MyExtendedServlet
{
public ModifyStudEntrScore()
{
}
public void handle()
throws IOException, ServletException
{
UserInfo userInfo = (UserInfo)session.getAttribute("USERINFO");
int userAuthority = super.checkAuthority(userInfo, 1, 0);
if(userAuthority != 1)
return;
reqInfo = UploadRequest.upload(req);
Long rowsID = new Long((String)reqInfo.get("RowsID"));
String studentID = "";
if(userInfo.getUserType().equals(new Integer(1)))
studentID = userInfo.getUserID();
else
if(userInfo.getUserType().equals(new Integer(3)))
studentID = (String)reqInfo.get("StudentID");
String examID = (String)reqInfo.get("ExamID");
String studentType = (String)reqInfo.get("StudentType");
String fstCourseName = (String)reqInfo.get("FstCourseName");
Float fstCourseScore = new Float((String)reqInfo.get("FstCourseScore"));
String scndCourseName = (String)reqInfo.get("ScndCourseName");
Float scndCourseScore = new Float((String)reqInfo.get("ScndCourseScore"));
String thrdCourseName = (String)reqInfo.get("ThrdCourseName");
Float thrdCourseScore = new Float((String)reqInfo.get("ThrdCourseScore"));
String frthCourseName = (String)reqInfo.get("FrthCourseName");
Float frthCourseScore = new Float((String)reqInfo.get("FrthCourseScore"));
TblStudentEntrScore studentEntrScore = null;
String errorMessage = "";
boolean result = false;
if(rowsID != null)
try
{
InitialContext jndiContext = new InitialContext();
StudentSessionLocalHome home = (StudentSessionLocalHome)jndiContext.lookup("StudentSessionLocal");
StudentSessionLocal local = home.create();
studentEntrScore = local.getStudEntrScoreByID(rowsID);
if(studentEntrScore != null)
{
studentEntrScore.setExamID(examID);
studentEntrScore.setFstCourseName(fstCourseName);
studentEntrScore.setFstCourseScore(fstCourseScore);
studentEntrScore.setScndCourseName(scndCourseName);
studentEntrScore.setScndCourseScore(scndCourseScore);
studentEntrScore.setThrdCourseName(thrdCourseName);
studentEntrScore.setThrdCourseScore(thrdCourseScore);
studentEntrScore.setFrthCourseName(frthCourseName);
studentEntrScore.setFrthCourseScore(frthCourseScore);
result = true;
} else
{
errorMessage = "数据库中没有该学生的入学成绩.";
}
local.remove();
jndiContext.close();
result = true;
}
catch(Exception e)
{
errorMessage = "当修改学生入学成绩时出现错误.";
result = false;
e.printStackTrace();
}
else
errorMessage = "传进来的学生入学成绩关键字为空.";
if(result)
{
getServletContext().getRequestDispatcher("/student/studentrscore.jsp?StudentID=" + studentID).forward(req, res);
} else
{
session.setAttribute("ERRORMESSAGE", errorMessage);
getServletContext().getRequestDispatcher("/error/error.jsp").forward(req, res);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -