📄 productservicebean.java~23~
字号:
package xian.bin.serivce;import java.util.*;import app.Test;import xian.bin.product.*;public class ProductServiceBean implements ServiceProduct { private Test test=null; public ProductServiceBean() { test=Test.getTest(); } //添加商品信息 public void addProduct(String pname, String brand, String spec, String unit, float price, float assprice, String pictrue, String explain, String bigcatalog, String smaillcatalog) throws Exception { try{ test.prodInfoHome.create().addProduct(pname,brand,spec,unit,price,assprice,pictrue,explain,bigcatalog,smaillcatalog); } catch(Exception e){ e.printStackTrace(); } } //获得所有商品信息 public Collection getAllProduct() throws Exception { try{ return test.prodInfoHome.create().getAllProduct(); } catch(Exception e){ e.printStackTrace(); } return null; } //删除商品信息 public void delProduct(String pid) throws Exception { try{ test.prodInfoHome.create().delProduct(pid); } catch(Exception e){ e.printStackTrace(); } } //获得一个商品信息 public ProductDTO getProduct(String pid) throws Exception { try{ return test.prodInfoHome.create().getProduct(pid); } catch(Exception e){ e.printStackTrace(); } return null; } //修改商品信息 public void updateProduct(String pid, String pname, String brand, String spec, String unit, float price, float assprice, String pictrue, String explain, String bigcatalog, String smaillcatalog) throws Exception { try{ test.prodInfoHome.create().updateProduct(pid,pname,brand,spec,unit,price,assprice,pictrue,explain,bigcatalog,smaillcatalog); } catch(Exception e){ e.printStackTrace(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -