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

📄 bindlogic.java~8~

📁 库存管理系统。 具有入库、出库、盘点、专库、统计等功能。
💻 JAVA~8~
字号:
package com.inv.logic;

import com.inv.dao.HbmDAO;
import com.inv.actionform.BindActionForm;
import java.util.List;
import com.inv.vo.Bind;
import com.inv.vo.Inventory;
import java.util.Iterator;
import com.inv.dao.DAOException;

public class BindLogic {
  private HbmDAO dao;
    private BindActionForm form;
    public BindLogic() {
        dao = new HbmDAO();
        dao.setAutoClose(false);
    }
    public void getBinds()
    {
      String str = "from Bind";
      List users = dao.list(str);
      form.setBinds(users);
  }
  public void addBind()
  {
        Bind bind = new Bind();

        List inventorys = dao.list("from Inventory");
       if(inventorys.size()>0)
       {
         Inventory inventory = (Inventory)inventorys.get(0);
         bind.setInvUID(inventory.getInvUID());
         bind.setBindCode("");
         bind.setBindUID(null);
       }
        form.getBinds().add(bind);

  }
  public void saveBind()
  {
    List binds = form.getBinds();
    for (Iterator iter = binds.iterator(); iter.hasNext(); ) {
      Bind item = (Bind)iter.next();
      if(item.getBindUID().equals(new Long(0)))
      {
        item.setBindUID(null);
      }
      try {
        dao.store(item);
      }
      catch (DAOException ex) {
        ex.printStackTrace();
      }
    }
  }
  public void deleteUser()
  {
    Long uid = form.getDeleteUID();
    try {
      dao.remove(User.class, uid);
    }
    catch (DAOException ex) {
      ex.printStackTrace();
    }
  }

    public void closeDAO()
    {
      dao.closeSession();
    }


}

⌨️ 快捷键说明

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