📄 _action__jsp.java
字号:
/*
* JSP generated by Resin 2.1.2 (built Tue Jun 11 08:26:56 PDT 2002)
*/
package _admin._info;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import org.ehotsoft.yekki.sql.SQLFacade;
import org.ehotsoft.yekki.sql.Storage;
import org.ehotsoft.yekki.util.ParamUtil;
import org.ehotsoft.yekki.util.SkinUtil;
import org.ehotsoft.yekki.util.DateTimeUtil;
import org.ehotsoft.yekki.util.StringUtil;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
import java.sql.Connection;
public class _action__jsp extends com.caucho.jsp.JavaPage{
private boolean _caucho_isDead;
public void
_jspService(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException
{
com.caucho.jsp.QPageContext pageContext = (com.caucho.jsp.QPageContext) com.caucho.jsp.QJspFactory.create().getPageContext(this, request, response, null, true, 8192, true);
javax.servlet.jsp.JspWriter out = (javax.servlet.jsp.JspWriter) pageContext.getOut();
javax.servlet.ServletConfig config = getServletConfig();
javax.servlet.Servlet page = this;
javax.servlet.http.HttpSession session = pageContext.getSession();
javax.servlet.ServletContext application = pageContext.getServletContext();
response.setContentType("text/html;charset=gb2312");
request.setCharacterEncoding("GB2312");
try {
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
String action = ParamUtil.getStringParameter( request, "action" );
String operator = ParamUtil.getStringParameter( request, "operator" );
if ( !operator.equals( "" ) ) {
action = operator;
}
SQLFacade facade = new SQLFacade();
String sql = null;
Connection cnn = null;
PreparedStatement pstmt = null;
try {
if ( action.equals( "add_category" ) ) {
String caption = ParamUtil.getStringParameter( request, "caption" );
String archive = ParamUtil.getStringParameter( request, "archive" );
int identity_id = ParamUtil.getIntParameter( request, "identity_id" );
int father_id = ParamUtil.getIntParameter( request, "father_id" );
if ( caption .equals( "" ) ) {
SkinUtil.alert( out, "请填写标题" );
}
else if ( archive.equals( "" ) ) {
SkinUtil.alert( out, "请填写归档名" );
}
else if ( identity_id == -1 ) {
SkinUtil.alert( out, "标识符应为整数!" );
}
else {
sql = "select caption, archive, identity_id from tbl_info_category where caption=? or identity_id=? or archive=?";
cnn = facade.getConnection();
pstmt = cnn.prepareStatement( sql );
pstmt.setString( 1, caption );
pstmt.setInt( 2, identity_id );
pstmt.setString( 3, archive );
ResultSet rst = pstmt.executeQuery();
if ( rst.next() ) {
if ( caption.equals( rst.getString( "caption" ) ) ) {
SkinUtil.alert( out, "标题重复!" );
}
else if ( identity_id == rst.getInt( "identity_id" ) ) {
SkinUtil.alert( out, "标识符重复!" );
}
else if ( archive.equals( rst.getString( "archive" ) ) ) {
SkinUtil.alert( out, "归档名重复!" );
}
}
else {
sql = "insert into tbl_info_category( id, caption, archive, identity_id, father_id ) values( seq_info.nextval, ?, ?, ?, ? )";
pstmt = cnn.prepareStatement( sql );
pstmt.setString( 1, caption );
pstmt.setString( 2, archive );
pstmt.setInt( 3, identity_id );
pstmt.setInt( 4, father_id );
pstmt.execute();
response.sendRedirect( "add_category.jsp?father_id=" + father_id );
}
}
}
if ( action.equals( "edit_category" ) ) {
int id = ParamUtil.getIntParameter( request, "id" );
String caption = ParamUtil.getStringParameter( request, "caption" );
String archive = ParamUtil.getStringParameter( request, "archive" );
int identity_id = ParamUtil.getIntParameter( request, "identity_id" );
int father_id = ParamUtil.getIntParameter( request, "father_id" );
if ( caption .equals( "" ) ) {
SkinUtil.alert( out, "请填写标题" );
}
else if ( archive.equals( "" ) ) {
SkinUtil.alert( out, "请填写归档名" );
}
else if ( identity_id == -1 ) {
SkinUtil.alert( out, "标识符应为整数!" );
}
else {
sql = "select caption, archive, identity_id from tbl_info_category where ( caption=? or archive=? or identity_id=? ) and id<>?";
cnn = facade.getConnection();
pstmt = cnn.prepareStatement( sql );
pstmt.setString( 1, caption );
pstmt.setString( 2, archive );
pstmt.setInt( 3, identity_id );
pstmt.setInt( 4, id );
ResultSet rst = pstmt.executeQuery();
if ( rst.next() ) {
if ( caption.equals( rst.getString( "caption" ) ) ) {
SkinUtil.alert( out, "类别标题重复!" );
}
else if ( archive.equals( rst.getString( "archive" ) ) ) {
SkinUtil.alert( out, "归档名重复!" );
}
else if ( identity_id == rst.getInt( "identity_id" ) ) {
SkinUtil.alert( out, "标识符重复!" );
}
}
else {
sql = "update tbl_info_category set caption=?, archive=?, identity_id=?, father_id=? where id=?";
cnn = facade.getConnection();
pstmt = cnn.prepareStatement( sql );
pstmt.setString( 1, caption );
pstmt.setString( 2, archive );
pstmt.setInt( 3, identity_id );
pstmt.setInt( 4, father_id );
pstmt.setInt( 5, id );
pstmt.execute();
response.sendRedirect( "category.jsp?father_id=" + father_id );
}
}
}
if ( action.equals( "del_category" ) ) {
String id = ParamUtil.getStringParameter( request, "id" );
int father_id = ParamUtil.getIntParameter( request, "father_id" );
sql = "delete from tbl_info_category where id=" + id + " or father_id=" + id;
facade.executeUpdate( sql );
response.sendRedirect( "category.jsp?father_id=" + father_id );
}
if ( action.equals( "add_template" ) ) {
String caption = ParamUtil.getStringParameter( request, "caption" );
String content = ParamUtil.getStringParameter( request, "content" );
int identity_id = ParamUtil.getIntParameter( request, "identity_id" );
if ( caption .equals( "" ) ) {
SkinUtil.alert( out, "请填写标题" );
}
else if ( identity_id == -1 ) {
SkinUtil.alert( out, "标识符应为整数!" );
}
else {
sql = "select caption,identity_id from tbl_info_template where caption=? or identity_id=?";
cnn = facade.getConnection();
pstmt = cnn.prepareStatement( sql );
pstmt.setString( 1, caption );
pstmt.setInt( 2, identity_id );
ResultSet rst = pstmt.executeQuery();
if ( rst.next() ) {
if ( caption.equals( rst.getString( "caption" ) ) ) {
SkinUtil.alert( out, "标题重复!" );
}
else if ( identity_id == rst.getInt( "identity_id" ) ) {
SkinUtil.alert( out, "标识符重复!" );
}
}
else {
sql = "insert into tbl_info_template ( id, caption, identity_id, content ) values( seq_info.nextval, ?, ?, ? )";
cnn = facade.getConnection();
pstmt = cnn.prepareStatement( sql );
pstmt.setString( 1, caption );
pstmt.setInt( 2, identity_id );
pstmt.setString( 3, content );
pstmt.execute();
response.sendRedirect( "template.jsp" );
}
}
}
if ( action.equals( "edit_template" ) ) {
String caption = ParamUtil.getStringParameter( request, "caption" );
String content = ParamUtil.getStringParameter( request, "content" );
int id = ParamUtil.getIntParameter( request, "id", -1 );
if ( caption .equals( "" ) ) {
SkinUtil.alert( out, "请填写标题" );
}
else {
sql = "select caption from tbl_info_template where caption=? and id<>?";
cnn = facade.getConnection();
pstmt = cnn.prepareStatement( sql );
pstmt.setString( 1, caption );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -