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

📄 businessdelegate.java

📁 基于struts的电子银行系统,为网上用户提供存款,取款,转帐等服务,拥有后台处理系统
💻 JAVA
字号:
/*
 * Created on 2005-7-24
 *
 */
package banksystem.business;

/**
 * @author 曲本盛
 *
 * TODO Struts 项目实践
 */
import java.util.*;
import java.sql.SQLException;
import javax.sql.*;
import banksystem.PO.*;
import banksystem.exception.*;
import banksystem.Constants;
public class BusinessDelegate {
	private BusinessDelegate(){}
	//将该类定义成一个Singleton
	private static BusinessDelegate businessDele = new BusinessDelegate();
	
	public static BusinessDelegate getInstance(){
		return businessDele;
	}
	
	public List getSearchTradeResult(DataSource dataSource,SearchGene gene)throws SQLException{
		return new GetTradeRecord().getTrades(dataSource,gene);
	}
	
	public List getSearchCustomerResult(DataSource dataSource,SearchGene gene)throws SQLException{
		return new GetCustomerRecord().getCustomers(dataSource,gene);
	}
	
	public void setAccountStatus(DataSource dataSource,SearchGene gene)throws SQLException,Exception{
			new AdminFreezdAccount().setAccountStatus(dataSource,gene);
	}
	
	public void tradeBusiness(DataSource dataSource,Trade trade)throws AccountFreezedException,TranferAccountNotExistException,BalanceNotEnoughException,SQLException{
		new TradeBusiness().trade(dataSource,trade);
	}
	
	public void userInfoSave(DataSource dataSource,Customer customer,String action)throws SQLException,Exception{
		UserInfoSave uis = new UserInfoSave();
		if("modify".equals(action)){
			uis.update(dataSource,customer);
		}
		else if("create".equals(action)){
			uis.save(dataSource,customer);
		}
		else {
			throw new SQLException(Constants.ERRORS_INVALID_INPUT);
		}
	}
	
	public void checkLogin(DataSource dataSource,Customer customer,SearchGene gene)throws AccountNotExistException,UserPasswordInvalidException,SQLException{
		new UserLogin().checkUser(dataSource,customer,gene);	
	}
	public Customer getCustomer(DataSource dataSource,String accountID) throws SQLException,Exception{
		return new GetCustomerRecord().getCustomer(dataSource,accountID);
	}
}

⌨️ 快捷键说明

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