⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aadmincategoryadd.java

📁 在线模拟选课系统
💻 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 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -