aadmincategoryadd.java

来自「在线模拟选课系统」· Java 代码 · 共 58 行

JAVA
58
字号
/*
 * 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 AAdminCategoryAdd
{
    //到首页
    public void doRegister( Hashtable inputData, 
                             Hashtable outputData,
                             HttpSession mySession )
        throws Exception
    {
        //首先获得要修改的问题详细信息
        String sCategoryName   = (String)inputData.get("categoryName");
        String sQuestionNumber = (String)inputData.get("questionNumber");
        String sTestTime       = (String)inputData.get("testTime");
        
        //生成一个Category对象以调用
        Category categoryObj = new Category();
        categoryObj.setCategoryName( sCategoryName );
        categoryObj.setQuestionNumber( (new Integer(sQuestionNumber)).intValue() );
        categoryObj.setTestTime( (new Integer(sTestTime)).intValue() );
        
        //调用对应的logic类
        LCategory lCategory = (LCategory)GlobalObjectProvider.getLogicService(CommonConst.LOGIC_KEY_CATEGORY);
        //删除对应的记录
        lCategory.addCategory( categoryObj );
        
        //然后重新检索
        Vector vCategorys = lCategory.getAllCategory();
        
        outputData.put( "pageId", CommonConst.VIEWID_ADMIN_CATEGORY_LIST);
        //往值域中设置当前题目及位置信息
        outputData.put( "categorys", vCategorys );
        return;
    }
    

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?