?? categoryproxy.java
字號:
package com.publish.shop.product.javabeans;
import java.util.HashMap;
import java.util.ArrayList;
import com.publish.shop.util.javabeans.*;
import com.publish.shop.product.dao.CategoryDAO;
import org.apache.struts.util.LabelValueBean;
public class CategoryProxy {
CategoryDAO dao = null;
public CategoryProxy(){
dao = new CategoryDAO();
}
public ArrayList queryCategoryLabel(CategoryModel model) throws Exception{
ArrayList lList = new ArrayList();
ArrayList lList01 = dao.queryCategory(model);
if(lList01!=null && lList01.size()>0){
for(int i=0;i<lList01.size();i++){
CategoryModel lModel = (CategoryModel)lList01.get(i);
lList.add(new LabelValueBean(lModel.getCatName(),lModel.getCatId()));
}
}
return lList01;
}
public ArrayList queryCategory(CategoryModel model) throws Exception{
ArrayList lList = new ArrayList();
lList = dao.queryCategory(model);
return lList;
}
public ArrayList queryCategory(CategoryModel model,Pager pager) throws Exception{
ArrayList lList = new ArrayList();
lList = dao.queryCategory(model);
return Utility.generatePager(lList,pager);
}
public CategoryModel queryCategory(String catId) throws Exception{
return dao.queryCategory(catId);
}
public CategoryModel queryCatByName(String catId) throws Exception{
return dao.queryCatByName(catId);
}
public void insertCategory(CategoryModel model) throws Exception{
dao.insert(model);
}
public void updateCategory(CategoryModel model) throws Exception{
dao.update(model);
}
public void deleteCategory(String catId) throws Exception{
dao.delete(catId);
}
public ArrayList getCatLabel() throws Exception
{
return dao.getCatLabel();
}
public ArrayList getCatLabelAddAll(){
ArrayList list = new ArrayList();
try
{
list = dao.getCatLabel();
list.add(0, new LabelValueBean(Utility.getMessage("label.all"), ""));
}
catch(Exception e)
{
e.printStackTrace();
list = null;
}
return list;
}
public ArrayList getCatgroyLabelAll()
{
ArrayList list=new ArrayList();
try
{
list=dao.getAllCatLabel();
}
catch(Exception e)
{
}
return list;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -