📄 businessdelegate.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 + -