📄 addstudentaward.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: AddStudentAward.java
package com.saintbo.servlet.student;
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 java.text.DateFormat;
import javax.naming.InitialContext;
import javax.servlet.*;
import javax.servlet.http.HttpSession;
public class AddStudentAward extends MyExtendedServlet
{
public AddStudentAward()
{
}
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);
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 awardID = (String)reqInfo.get("AwardID");
String awardDescript = (String)reqInfo.get("AwardDescript");
String strAwardDate = (String)reqInfo.get("AwardDate");
String awardMethod = (String)reqInfo.get("AwardMethod");
String awardFrom = (String)reqInfo.get("AwardFrom");
String awardFileID = (String)reqInfo.get("AwardFileID");
String comments = (String)reqInfo.get("Comments");
com.saintbo.entity.student.TblStudentAward studentAward = null;
String errorMessage = "";
boolean result = false;
if(studentID != null && !studentID.trim().equals(""))
try
{
InitialContext jndiContext = new InitialContext();
StudentSessionLocalHome home = (StudentSessionLocalHome)jndiContext.lookup("StudentSessionLocal");
StudentSessionLocal local = home.create();
java.util.Date awardDate = DateFormat.getDateInstance().parse(strAwardDate);
studentAward = local.addStudAward(studentID, awardID, awardDescript, awardDate, awardMethod, awardFrom, awardFileID, comments);
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 + -