资源简介
物资管理系统,亲测可用,使用mysql数据库内含mysql表备份文件
代码片段和文件信息
package com.action;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForward;
import com.actionForm.BranchForm;
import org.apache.struts.action.Action;
import com.dao.BranchDAO;
public class Branch extends Action {
BranchDAO branchDAO=null;
public Branch() {
branchDAO = new BranchDAO();
}
public ActionForward execute(ActionMapping mapping ActionForm form
HttpServletRequest request
HttpServletResponse response) {
BranchForm branchForm = (BranchForm) form;
String action=request.getParameter(“action“);
if(action.equals(““) || action==null){
request.setAttribute(“err““您的操作有误!“);
return mapping.findForward(“error“);
}else if(action.equals(“branchQuery“)){
return branchQuery(mappingformrequestresponse);
}else if(action.equals(“branchdel“)){
return branchDel(mapping form request response);
}else if(action.equals(“branchadd“)){
return branchAdd(mapping form request response);
}
return mapping.findForward(“error“);
}
public ActionForward branchQuery(ActionMapping mapping ActionForm form
HttpServletRequest request
HttpServletResponse response) {
String str = ““;
request.setAttribute(“branchList“ branchDAO.query(str));
return mapping.findForward(“branchQuery“);
}
public ActionForward branchDel(ActionMapping mapping ActionForm form
HttpServletRequest request
HttpServletResponse response) {
int id=Integer.parseInt(request.getParameter(“id“));
int rtn=branchDAO.del(id);
if(rtn==0){
request.setAttribute(“error““该部门信息不能删除!“);
return mapping.findForward(“error“);
}else{
return mapping.findForward(“branchdelok“);
}
}
public ActionForward branchAdd(ActionMapping mapping ActionForm form
HttpServletRequest request
HttpServletResponse response) {
BranchForm branchForm = (BranchForm) form;
int rtn=branchDAO.insert(branchForm);
if(rtn==2){
request.setAttribute(“error““该部门信息已经存在!“);
return mapping.findForward(“error“);
}else if(rtn==1){
return mapping.findForward(“branchaddok“);
}else{
request.setAttribute(“error““部门信息添加失败!“);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 529 2016-04-07 13:22 07\.classpath
....... 279 2014-04-24 17:56 07\.myme
文件 1608 2016-04-07 09:39 07\.project
....... 500 2014-04-24 17:56 07\.settings\.jsdtscope
文件 364 2016-04-07 09:41 07\.settings\org.eclipse.jdt.core.prefs
文件 442 2016-04-07 10:03 07\.settings\org.eclipse.wst.common.component
文件 219 2016-04-07 09:43 07\.settings\org.eclipse.wst.common.project.facet.core.xm
....... 49 2014-04-24 17:56 07\.settings\org.eclipse.wst.jsdt.ui.superType.container
....... 6 2014-04-24 17:56 07\.settings\org.eclipse.wst.jsdt.ui.superType.name
....... 0 2014-04-24 17:56 07\src\ApplicationResources.properties
....... 3108 2014-04-24 17:56 07\src\com\action\Branch.java
....... 2460 2014-04-24 17:56 07\src\com\action\Cart.java
....... 2679 2014-04-24 17:56 07\src\com\action\Damage.java
....... 2568 2014-04-24 17:56 07\src\com\action\GetUse.java
....... 4289 2014-04-24 17:56 07\src\com\action\Goods.java
....... 8907 2014-04-24 17:56 07\src\com\action\IfDeal.java
文件 4295 2016-04-07 15:44 07\src\com\action\Instorage.java
....... 4514 2014-04-24 17:56 07\src\com\action\Loan.java
....... 4388 2014-04-24 17:56 07\src\com\action\Provider.java
....... 530 2014-04-24 17:56 07\src\com\action\SelfRequestProcessor.java
....... 5896 2014-04-24 17:56 07\src\com\action\User.java
....... 864 2014-04-24 17:56 07\src\com\actionForm\BranchForm.hbm.xm
文件 1213 2016-04-07 17:04 07\src\com\actionForm\BranchForm.java
....... 465 2014-04-24 17:56 07\src\com\actionForm\CheckForm.hbm.xm
文件 658 2016-04-08 08:56 07\src\com\actionForm\CheckForm.java
....... 1082 2014-04-24 17:56 07\src\com\actionForm\DamageForm.hbm.xm
文件 1997 2016-04-08 08:57 07\src\com\actionForm\DamageForm.java
....... 1069 2014-04-24 17:56 07\src\com\actionForm\GetUseForm.hbm.xm
....... 1927 2014-04-24 17:56 07\src\com\actionForm\GetUseForm.java
....... 1415 2014-04-24 17:56 07\src\com\actionForm\GoodsForm.hbm.xm
............此处省略208个文件信息
评论
共有 条评论