📄 modifystudsecspecialtyreg.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: ModifyStudSecSpecialtyReg.java
package com.saintbo.servlet.student;
import com.saintbo.entity.student.TblSecSpecialtyReg;
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.io.PrintStream;
import java.text.DateFormat;
import javax.naming.InitialContext;
import javax.servlet.*;
import javax.servlet.http.HttpSession;
public class ModifyStudSecSpecialtyReg extends MyExtendedServlet
{
public ModifyStudSecSpecialtyReg()
{
}
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 = "";
String status = "0";
String strRegDate = "";
String errorMessage = "";
boolean result = false;
try
{
java.util.Date regDate = null;
if(userInfo.getUserType().equals(new Integer(1)))
studentID = userInfo.getUserID();
else
if(userInfo.getUserType().equals(new Integer(3)))
{
studentID = (String)reqInfo.get("StudentID");
status = (String)reqInfo.get("Status");
strRegDate = (String)reqInfo.get("RegDate");
regDate = DateFormat.getDateInstance().parse(strRegDate);
}
Long rowsID = new Long((String)reqInfo.get("RowsID"));
String specialtyID = (String)reqInfo.get("SpecialtyID");
String strApplyDate = (String)reqInfo.get("AppDate");
System.out.println("RowsID:" + rowsID);
System.out.println("SpecialtyID:" + specialtyID);
System.out.println("AppDate:" + specialtyID);
System.out.println("RowsID:" + rowsID);
TblSecSpecialtyReg secSpecialtyReg = null;
if(rowsID != null && studentID != null && !studentID.trim().equals(""))
{
InitialContext jndiContext = new InitialContext();
StudentSessionLocalHome home = (StudentSessionLocalHome)jndiContext.lookup("StudentSessionLocal");
StudentSessionLocal local = home.create();
java.util.Date appDate = DateFormat.getDateInstance().parse(strApplyDate);
secSpecialtyReg = local.getStudSecSpecialtyRegByID(rowsID);
if(secSpecialtyReg != null && secSpecialtyReg.getRowsID() != null)
{
if(userInfo.getUserType().equals(new Integer(1)))
{
if(secSpecialtyReg.getStatus().equals("0"))
{
secSpecialtyReg.setSpecID(specialtyID);
secSpecialtyReg.setAppDate(appDate);
result = true;
} else
{
errorMessage = "此第二专业/辅修信息已经回复,您不能修改.";
}
} else
if(userInfo.getUserType().equals(new Integer(3)))
{
secSpecialtyReg.setSpecID(specialtyID);
secSpecialtyReg.setAppDate(appDate);
secSpecialtyReg.setStatus(status);
secSpecialtyReg.setRegDate(regDate);
result = true;
}
} else
{
errorMessage = "由于某些不知明的原因没有成功修改学生第二专业/辅修信息.";
}
local.remove();
jndiContext.close();
} else
{
errorMessage = "传进来的学生学号或第二专业/辅修信息的关键定不能为空.";
}
if(result)
{
getServletContext().getRequestDispatcher("/student/studsecspecialtyreg.jsp?RowsID=" + rowsID).forward(req, res);
} else
{
session.setAttribute("ERRORMESSAGE", errorMessage);
getServletContext().getRequestDispatcher("/error/error.jsp").forward(req, res);
}
}
catch(Exception e)
{
errorMessage = "当修改学生第二专业/辅修信息时出现错误.";
System.out.println(errorMessage);
result = false;
e.printStackTrace();
session.setAttribute("ERRORMESSAGE", errorMessage);
getServletContext().getRequestDispatcher("/error/error.jsp").forward(req, res);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -