⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 categoryproxy.java

📁 这是jsp网站开发死酷全书的代码
💻 JAVA
字号:
package com.publish.shop.product.javabeans;

import java.sql.Connection;
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 lList;
  }

  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 = null;
    try
    {
      list = dao.getCatLabel();
      list.add(0, new LabelValueBean(Utility.getMessage("label.all"), ""));
      return list;
    }
    catch(Exception e)
    {
      e.printStackTrace();
      list = null;
    }
    finally
    {
      return list;
    }

  }

}

⌨️ 快捷键说明

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