?? entrylibrarybean.java
字號:
/*
* @(#)BusinessBean.java
*
* Copyright 2003 by SYNTC, All rights reserved.
*
* This software is the confidential and proprietary information of SYNTC.
* ("Confidential Information").
*/
package cn.com.syntc.webapp.business;
import javax.servlet.*;
import javax.servlet.http.*;
import cn.com.syntc.common.action.*;
import cn.com.syntc.common.io.*;
import cn.com.syntc.common.util.*;
import cn.com.syntc.common.type.*;
import cn.com.syntc.webapp.taglib.CheckLogin;
import cn.com.syntc.webapp.session.UserSession;
/**
* 添加試題<br>
* @author wang yong
* @version 1.0
*/
public class EntryLibraryBean extends BusinessLogic{
/**
* 構(gòu)造函數(shù)
*/
public EntryLibraryBean(){
System.out.println("FrameWork:業(yè)務(wù)處理類實例化完成【" + this.getClass().getName() + "】");
}
/**
* 業(yè)務(wù)邏輯處理機能
*/
public void execute(HttpServletRequest request, HttpServletResponse response, Parameters parameters) throws CommonException{
try{
String strSql = "";
ResultSet resultset = null;
SqlUtil sqlutil = new SqlUtil();
UserSession USession = (UserSession)request.getSession().getAttribute("UserSession");
String libid = "";
if(request.getParameter("libid")!=null)
{
libid = (String)request.getParameter("libid");
}
String command = "";
if(parameters.getParameters("request", "command")!=null)
{
command = (String)parameters.getParameters("request", "command");
}
if(command.equals("del"))
{
String libraryid[] = null;
if(request.getParameterValues("libraryid")!=null)
{
libraryid = (String[])request.getParameterValues("libraryid");
for(int i=0; i<libraryid.length; i++)
{
// 刪除題庫
strSql = "DELETE FROM LIBRARY_TBL WHERE LIBRARYID = '" + libraryid[i] + "'";
sqlutil.executeUpdate(strSql);
}
}
}
else if(command.equals("onoff"))
{
String libraryid = "";
if(request.getParameter("libraryid")!=null)
{
libraryid = (String)request.getParameter("libraryid");
}
String onoff = "0";
if(request.getParameter("onoffvalue")!=null)
{
onoff = (String)request.getParameter("onoffvalue");
}
// 改變題庫可用狀態(tài)
strSql = "UPDATE LIBRARY_TBL SET ONOFF='" + onoff + "' WHERE LIBRARYID = '" + libraryid + "'";
sqlutil.executeUpdate(strSql);
}
else
{
}
strSql = "SELECT A.LIBID,A.LIBRARYID,B.CATEGORYNAME,C.LEVELNAME,A.TITLE,A.ONOFF FROM LIBRARY_TBL A,CATEGORY_TBL B,LEVEL_TBL C WHERE A.CATEGORYID=B.CATEGORYID AND A.LEVELID=C.LEVELID AND LIBID='" + libid + "' ORDER BY A.CATEGORYID,A.CREATETIME ";
resultset = sqlutil.executeQuery(strSql);
sqlutil.close();
parameters.setParameters("results","LibraryList", resultset);
parameters.setParameters("results", "ForwardPage", "/framework/exam/librarylist.jsp");
}
catch(Exception ex){
System.out.println("error:"+ex.getMessage());;
}
}
/**
* 頁面表單檢測處理機能
*/
public void validate(HttpServletRequest request, HttpServletResponse response, Parameters parameters) throws CommonException{
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -