goodbiz.java

来自「网上购物系统 主要实现订单查询 订单各种操作 等」· Java 代码 · 共 105 行

JAVA
105
字号
package eshopsys.good.biz;

import eshopsys.tools.base.*;
import eshopsys.tools.database.*;
import eshopsys.good.model.*;

import java.sql.*;

public class GoodBiz extends BaseBiz {
String tableName="tbl_good";
GoodDao goodDao=new GoodDao();

public GoodBiz() {
	this.baseDao = new GoodDao();
}

public void registerGood(GoodEntity good) throws Exception
{
	try{
	////////////////////////////////////////		
	goodDao.insert(good);
    ////////////////////////////////////////
	}
	catch(Exception e)
	{
		throw e;
	}
	finally{
		//goodDao.CloseConnection();
	}
	
}
//////////////////////////////////////////////////////////////////////////
public GoodEntity registerGoodReturnEntity(GoodEntity good) throws Exception
{
	try{
	////////////////////////////////////////		
	int id=goodDao.insertRetrunId(good);
	good.setGoodId(id);
    ////////////////////////////////////////
	}
	catch(Exception e)
	{
		throw e;
	}
	finally{
		//goodDao.CloseConnection();
	}
  return good;	
}
//////////////////////////////////////////////////////////////////////////
public void updateGood(GoodEntity good)throws Exception
{Connection con=DataBaseTool.getConnection();
  try{
	////////////////////////////////////////		
	goodDao.update(good);
    ////////////////////////////////////////
	}
	catch(Exception e)
	{
		throw e;
	}
	finally{
		//goodDao.CloseConnection();
	}
    	
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
public GoodEntity GetGoodEntityById(int id) throws Exception
{   GoodEntity good=null;
	try{
	////////////////////////////////////////		
	good=(GoodEntity)goodDao.selectById(tableName, "goodid", id);
    ////////////////////////////////////////
	}
	catch(Exception e)
	{
		throw e;
	}
	finally{
		//goodDao.CloseConnection();
	}
  return good;	
}
//////////////////////////////////////////////////////////////////////////
public void DeleteGoodEntityById(int id) throws Exception
{   GoodEntity good=null;
	try{
	////////////////////////////////////////		
	goodDao.deleteById(tableName, "goodid", id);
    ////////////////////////////////////////
	}
	catch(Exception e)
	{
		throw e;
	}
	finally{
		//goodDao.CloseConnection();
	}
}
//////////////////////////////////////////////////////////////////////////

}

⌨️ 快捷键说明

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