📄 aadmincategorylist.java
字号:
/*
* This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/).
*/
package ch07.action;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import ch07.*;
import ch07.object.unit.*;
import ch07.logic.*;
import ch07.global.*;
import ch07.database.*;
/**
* 针对管理系统分类一览的Servlet
* @author ShenYK
* @version 1.0
*/
public class AAdminCategoryList
{
//删除某个分类
public void doDelete( Hashtable inputData,
Hashtable outputData,
HttpSession mySession )
throws Exception
{
//首先获得要删除的分类ID
String sCategoryId = (String)inputData.get("categoryId");
//调用对应的logic类
LCategory lCategory = (LCategory)GlobalObjectProvider.getLogicService(CommonConst.LOGIC_KEY_CATEGORY);
//删除对应的分类
lCategory.deleteCategoryById( sCategoryId );
//然后重新检索
Vector vCategorys = lCategory.getAllCategory();
//确定要去的页面=分类选择页面
outputData.put( "pageId", CommonConst.VIEWID_ADMIN_CATEGORY_LIST);
//往值域中设置分类信息
outputData.put( "categorys", vCategorys );
return;
}
//修改某条试题
public void doModify( Hashtable inputData,
Hashtable outputData,
HttpSession mySession )
throws Exception
{
//首先获得要修改的分类ID
String sCategoryId = (String)inputData.get("categoryId");
//获得对应的问题的详细信息,然后迁移到详细信息修改页面
//调用对应的logic类
LCategory lCategory = (LCategory)GlobalObjectProvider.getLogicService(CommonConst.LOGIC_KEY_CATEGORY);
//获取对应的记录
Category categoryObj = lCategory.getCategoryById( sCategoryId );
//然后迁移到指定页面
outputData.put( "pageId", CommonConst.VIEWID_ADMIN_CATEGORY_MODIFY);
//往值域中设置当前题目及位置信息
outputData.put( "category", categoryObj );
return;
}
//添加一条新试题
public void doAdd( Hashtable inputData,
Hashtable outputData,
HttpSession mySession )
throws Exception
{
//不用设置任何值域,直接迁移过去即可
outputData.put( "pageId", CommonConst.VIEWID_ADMIN_CATEGORY_ADD);
return;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -