📄 suppliertypebusiness.java
字号:
package com.business;
import java.util.HashMap;
import com.business.vo.SupplierType;
import com.dao.util.DaoImp;
import com.web.util.WebTools;
/**
* @author Administrator
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
public class SupplierTypeBusiness {
public String getNameById(String id) throws Exception{
try{
String str = "select name from supplierType where id = "+id;
DaoImp dao = new DaoImp();
return WebTools.showEx(dao.find(str).get("NAME"));
}catch(Exception e){
return "";
}
}
public void add(SupplierType vo) throws Exception{
try{
String str = "insert into SupplierType(name) values('"+vo.getName()+"')";
DaoImp dao = new DaoImp();
dao.insert(str);
}catch(Exception e){
throw e;
}
}
public void edit(SupplierType vo) throws Exception{
try{
String str = "update supplierType set name = '"+vo.getName()+"' where Id = "+vo.getId();
DaoImp dao = new DaoImp();
dao.insert(str);
}catch(Exception e){
throw e;
}
}
public void remove(SupplierType vo) throws Exception{
try{
String str = "delete from SupplierType where Id = "+vo.getId();
DaoImp dao = new DaoImp();
dao.insert(str);
}catch(Exception e){
throw e;
}
}
public HashMap find(String key) throws Exception{
try{
String str = "select * from SupplierType where Id = "+key+"";
DaoImp dao = new DaoImp();
return dao.find(str);
}catch(Exception e){
return null;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -