priceservice.java

来自「《JSP网站开发典型模块与实例精讲》一书光盘源码」· Java 代码 · 共 39 行

JAVA
39
字号
package book.example.photoprint.service;

import java.util.List;

import org.apache.log4j.Logger;

import book.example.photoprint.dao.DAOFactory;
import book.example.photoprint.dao.IPriceDAO;
import book.example.photoprint.exception.DBException;
import book.example.photoprint.po.Price;
import book.example.photoprint.po.Shop;

public class PriceService {
	static Logger log = Logger.getLogger(PriceService.class.getName());
	public void addPrice(Price price) throws DBException {
		IPriceDAO dao = DAOFactory.getPriceDAO();
		log.info("保存服务价格:"+price.getType());
		dao.addPrice(price);
	}


	public void UpdatePrice(Price price) throws DBException {
		IPriceDAO dao = DAOFactory.getPriceDAO();
		dao.updatePrice(price);
	}
	public List list() throws DBException{
		IPriceDAO dao = DAOFactory.getPriceDAO();
		return dao.list();
	}
	public void delete(String priceid) throws DBException{
		IPriceDAO dao = DAOFactory.getPriceDAO();
		dao.deletePrice(priceid);
	}
	public List listByShopId(Shop shop) throws DBException{
		IPriceDAO dao = DAOFactory.getPriceDAO();
		return dao.listByShopId(shop);
	}
}

⌨️ 快捷键说明

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