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

📄 outlineservice.java

📁 中应用程序的访问权限对Java Web Console 中应用程序的访问权限 成功登录 Web 控制台后,可能无法自动访问在该控制台中注册的所有应用程序。通常,必须安装应用程序,才能让所有的用户在控制
💻 JAVA
字号:
/**
 * 
 */
package edu.yinhe.mis.services;

import java.sql.SQLException;
import java.util.ArrayList;


import edu.yinhe.mis.dto.OutlineDTO;
import edu.yinhe.mis.model.DAOFactory;
import edu.yinhe.system.common.AppException;
import edu.yinhe.system.model.IBaseDAO;
import edu.yinhe.system.services.Service;

/**
 * @author 陈忠
 * Creation date:04-30-2008 
 */
public class OutlineService extends Service  {
	
	private IBaseDAO outlineDAO=null;
	private IBaseDAO dictionary=null;
	public Object alllist() throws AppException {
		// TODO Auto-generated method stub
		return null;
	}

	public Object alllist(Object arg0) throws AppException {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * 向outline表中添加信息
	 * @throws AppException
	 * @param arg0 传入OutlineDTO对象
	 * @return flag 添加成功返回true。
	 */
	public Object create(Object arg0) throws AppException {
		OutlineDTO outlineDTO=(OutlineDTO)arg0;
		boolean flag=false;
		try {
			 outlineDAO=DAOFactory.getOutlineDAO(conn);
			outlineDAO.insert(outlineDTO);	
			flag=true;
		} catch (SQLException e) {
			try {
				conn.rollback();
			} catch (SQLException e1) {
				throw new AppException(e.getMessage()+"危险!");
			}
		}finally{
			this.closeConnection();
			outlineDAO=null;
		}
		return flag;
	}

	public Object findAll() throws AppException {
		// TODO Auto-generated method stub
		return null;
	}
	/**
	 * 查询Outline的所有信息
	 * @throws AppException
	 * @param arg0 传入OutlineDTO对象
	 * @return obj 返回Object[]类型的数组
	 */
	public Object findAll(Object arg0) throws AppException {
		OutlineDTO outlineDTO=(OutlineDTO)arg0;
		Object[] obj=null;
		try {
			
			 outlineDAO=DAOFactory.getOutlineDAO(conn);
			obj=(Object[]) outlineDAO.findAll(arg0);
		} catch (SQLException e) {
			try {
				conn.rollback();
			} catch (SQLException e1) {
				throw new AppException(e.getMessage()+"危险!");
			}
		}finally{
			this.closeConnection();
			outlineDTO=null;
			outlineDAO=null;
		}
		return obj;
	}

	public Object findById(Object arg0) throws AppException {
		// TODO Auto-generated method stub
		return null;
	}

	public Object findByObject(Object arg0) throws AppException {
		// TODO Auto-generated method stub
		return null;
	}

	public int getcount() throws AppException {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getcount(Object arg0) throws AppException {
		// TODO Auto-generated method stub
		return 0;
	}

	public Object list() throws AppException {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * 根据scope值查询数据
	 * @throws AppException
	 * @param arg0 DictionaryDTO对象
	 * @return list 返回objs类型的数组集合。
	 */
	public Object list(Object arg0) throws AppException {
		Object[] objs = null;
		try {
			dictionary=DAOFactory.getDictionaryDAO(conn);
			objs=(Object[]) dictionary.findAll(arg0);
		} catch (SQLException e) {
			try {
				conn.rollback();
			} catch (SQLException e1) {
				throw new AppException(e.getMessage()+"危险!");
			}
		}finally{
			closeConnection();
			dictionary=null;
		}
		return objs;
	}

	/**
	 * 根据id查询Outline的所有信息
	 * @throws AppException
	 * @param arg0 传入id号
	 * @return list 返回ArrayList类型的集合。
	 */
	public Object load(Object arg0) throws AppException {
		ArrayList list=null;
		try {
			 outlineDAO=DAOFactory.getOutlineDAO(conn);
			list=(ArrayList) outlineDAO.findById(arg0);
		} catch (SQLException e) {
			try {
				conn.rollback();
			} catch (SQLException e1) {
				throw new AppException(e.getMessage()+"危险!");
			}
		}finally{
			this.closeConnection();
			outlineDAO=null;
		}
		return list;
	}
	/**
	 * 修改outline表中的信息
	 * @throws AppException
	 * @param arg0 传入OutlineDTO对象
	 * @return flag 删除成功返回true,反之为false。
	 */
	public Object modify(Object arg0) throws AppException {
		boolean flag=false;
		try {
			 outlineDAO=DAOFactory.getOutlineDAO(conn);
			outlineDAO.update(arg0);
			flag=true;
		} catch (SQLException e) {
			try {
				conn.rollback();
			} catch (SQLException e1) {
				throw new AppException(e.getMessage()+"危险!");
			}
		}finally{
			this.closeConnection();
			outlineDAO=null;
		}
		
		return flag;
	}
	/**
	 * 删除Outline表中的信息
	 * @throws AppException
	 * @param arg0 id号
	 * @return flag 删除成功返回true,反之为false。
	 */
	public Object remove(Object arg0) throws AppException {
		boolean flag=false;
		try {
			 outlineDAO=DAOFactory.getOutlineDAO(conn);
			outlineDAO.delete(arg0);
			flag=true;
		} catch (SQLException e) {
			try {
				conn.rollback();
			} catch (SQLException e1) {
				throw new AppException(e.getMessage()+"危险!");
			}
		}finally{
			this.closeConnection();
			outlineDAO=null;
		}
		
		return flag;
	}


}

⌨️ 快捷键说明

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