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

📄 pojopricingbiz.java

📁 电信系统
💻 JAVA
字号:
package tarena.netctoss.biz;

import java.util.Collection;
import tarena.netctoss.dao.PricingDAO;
import tarena.netctoss.exception.InfrastructureException;
import tarena.netctoss.exception.RepeatBaseFeeAndRateFeeException;
import tarena.netctoss.model.Tpricing;

public class POJOPricingBIZ implements PricingBIZ {
    private PricingDAO pricingDAO;

    public void addPricing(Tpricing pricing) throws InfrastructureException,
            RepeatBaseFeeAndRateFeeException {
        Double baseFee = pricing.getBaseFee();
        Double rateFee = pricing.getRateFee();
        if(pricingDAO.selectPricingByBaseFeeAndRateFee(baseFee, rateFee) == true){
            throw new RepeatBaseFeeAndRateFeeException();
        }else{
            pricingDAO.insertPricing(pricing);
        }
    }

    public boolean exsitPricingByBaseFeeAndRateFee(Double baseFee,
            Double rateFee) throws InfrastructureException {
        return pricingDAO.selectPricingByBaseFeeAndRateFee(baseFee,rateFee);
    }

    public Collection findAllPricings() throws InfrastructureException {
        return pricingDAO.selectAllPricings();
    }

    public Tpricing findPricingById(Integer id) throws InfrastructureException {
        return pricingDAO.selectPricingById(id);
    }

    public void modifyPricing(Tpricing pricing) throws InfrastructureException {
        pricingDAO.updatePricing(pricing);
    }

    public void removePricing(Integer id) throws InfrastructureException {
        pricingDAO.deletePricing(id);
    }

    public void removePricing(Tpricing pricing) throws InfrastructureException {
        pricingDAO.deletePricing(pricing);
    }

    public void removePricings(Integer[] ids) throws InfrastructureException {
        pricingDAO.deletePricings(ids);
    }

    public void setPricingDAO(PricingDAO pricingDAO) {
        this.pricingDAO = pricingDAO;
    }

    public PricingDAO getPricingDAO() {
        return pricingDAO;
    }
}

⌨️ 快捷键说明

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