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

📄 aadminmenu.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 AAdminMenu
{
    //试题维护
    public void doQuestion ( Hashtable inputData, 
                              Hashtable outputData,
                              HttpSession mySession )
        throws Exception
    {
        //调用对应的logic类
        LCategory lCategory = (LCategory)GlobalObjectProvider.getLogicService(CommonConst.LOGIC_KEY_CATEGORY);
        
        //如果对应的类没有的话,报错并返回目录页面
        if ( lCategory == null )
        {
            outputData.put( "pageId", CommonConst.VIEWID_ADMIN_MENU );
            outputData.put( "errMsg", "发生了内部错误,请联系技术人员!" );
            return;
        }
        
        try
        {
            Vector vCategorys = lCategory.getAllCategory();
            if ( vCategorys == null )
            {
                outputData.put( "pageId", CommonConst.VIEWID_ADMIN_MENU );
                outputData.put( "errMsg", "发生了内部错误,请联系技术人员!" );
                return;
            }
            else
            {   //确定要去的页面=分类选择页面
                outputData.put( "pageId", CommonConst.VIEWID_ADMIN_CATEGORY);
                //往值域中设置分类信息
                outputData.put( "categorys", vCategorys );
                return;
            }
        }
        catch(Exception e)
        {
            e.printStackTrace();
            outputData.put( "pageId", CommonConst.VIEWID_ADMIN_MENU );
            outputData.put( "errMsg", "发生了内部错误,请联系技术人员!" );
            return;
        }
    }
    
    //分类设置维护
    public void doSetting ( Hashtable inputData, 
                             Hashtable outputData,
                             HttpSession mySession )
        throws Exception
    {
        //调用对应的logic类
        LCategory lCategory = (LCategory)GlobalObjectProvider.getLogicService(CommonConst.LOGIC_KEY_CATEGORY);
        
        //如果对应的类没有的话,报错并返回目录页面
        if ( lCategory == null )
        {
            outputData.put( "pageId", CommonConst.VIEWID_ADMIN_MENU );
            outputData.put( "errMsg", "发生了内部错误,请联系技术人员!" );
            return;
        }
        
        try
        {
            Vector vCategorys = lCategory.getAllCategory();
            if ( vCategorys == null )
            {
                outputData.put( "pageId", CommonConst.VIEWID_ADMIN_MENU );
                outputData.put( "errMsg", "发生了内部错误,请联系技术人员!" );
                return;
            }
            else
            {   
                //确定要去的页面=分类选择页面
                outputData.put( "pageId", CommonConst.VIEWID_ADMIN_CATEGORY_LIST);
                //往值域中设置分类信息
                outputData.put( "categorys", vCategorys );
                return;
            }
        }
        catch(Exception e)
        {
            e.printStackTrace();
            outputData.put( "pageId", CommonConst.VIEWID_ADMIN_MENU );
            outputData.put( "errMsg", "发生了内部错误,请联系技术人员!" );
            return;
        }
    }

    //查看历史成绩
    public void doHistory ( Hashtable inputData, 
                             Hashtable outputData,
                             HttpSession mySession )
        throws Exception
    {
        //调用对应的logic类
        LCategory lCategory = (LCategory)GlobalObjectProvider.getLogicService(CommonConst.LOGIC_KEY_CATEGORY);
        
        //如果对应的类没有的话,报错并返回目录页面
        if ( lCategory == null )
        {
            outputData.put( "pageId", CommonConst.VIEWID_ADMIN_MENU );
            outputData.put( "errMsg", "发生了内部错误,请联系技术人员!" );
            return;
        }
        
        try
        {
            Vector vCategorys = lCategory.getAllCategory();
            if ( vCategorys == null )
            {
                outputData.put( "pageId", CommonConst.VIEWID_ADMIN_MENU );
                outputData.put( "errMsg", "发生了内部错误,请联系技术人员!" );
                return;
            }
            else
            {   //确定要去的页面=历史成绩页面
                outputData.put( "pageId", CommonConst.VIEWID_ADMIN_HISTORY);
                //往值域中设置分类信息
                outputData.put( "categorys", vCategorys );
                return;
            }
        }
        catch(Exception e)
        {
            e.printStackTrace();
            outputData.put( "pageId", CommonConst.VIEWID_ADMIN_MENU );
            outputData.put( "errMsg", "发生了内部错误,请联系技术人员!" );
            return;
        }

    }    
    
}

⌨️ 快捷键说明

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