From 1171916d9e3c7619155b2427333d42a1a08ae15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=A6=A8=E8=8B=91?= <1803140727@qq.com> Date: Thu, 28 Dec 2023 20:41:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=8B=E9=A6=A8=E8=8B=91=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- com/csgw/ApplicationResources.properties | 2 + com/csgw/action/HzpsAction.java | 129 +++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 com/csgw/ApplicationResources.properties create mode 100644 com/csgw/action/HzpsAction.java diff --git a/com/csgw/ApplicationResources.properties b/com/csgw/ApplicationResources.properties new file mode 100644 index 0000000..bf45591 --- /dev/null +++ b/com/csgw/ApplicationResources.properties @@ -0,0 +1,2 @@ +# Resources for parameter 'com.csgw.struts.ApplicationResources' +# Project csgw \ No newline at end of file diff --git a/com/csgw/action/HzpsAction.java b/com/csgw/action/HzpsAction.java new file mode 100644 index 0000000..2f53385 --- /dev/null +++ b/com/csgw/action/HzpsAction.java @@ -0,0 +1,129 @@ +/* + * Generated by MyEclipse Struts + * Template path: templates/java/JavaClass.vtl + */ +package com.csgw.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import com.bean.HzpBean; +import com.util.Constant; + +/** + * MyEclipse Struts + * Creation date: 05-05-2010 + * + * XDoclet definition: + * @struts.action validate="true" + */ +public class HzpsAction extends Action { + /* + * Generated Methods + */ + + /** + * Method execute + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + */ + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + // TODO Auto-generated method stub + HttpSession session=request.getSession(); + HzpBean tb=new HzpBean(); + String method=request.getParameter("method").trim(); + ///////////////////////////////////////////////////////////////////////商品 + if(method.equals("deltrave")){ + String id=request.getParameter("id").trim(); + int flag = tb.delTrave(id); + if(flag == Constant.SUCCESS){ + request.setAttribute("message", "操作成功!"); + return (mapping.findForward("admin/hzp/index.jsp")); + } + else{ + request.setAttribute("message", "系统维护中,请稍后再试!"); + return (mapping.findForward("admin/hzp/index.jsp")); + } + } + else if(method.equals("hotdeltrave")){ + String id=request.getParameter("id").trim(); + int flag = tb.delTrave(id); + if(flag == Constant.SUCCESS){ + request.setAttribute("message", "操作成功!"); + return (mapping.findForward("admin/hzp/hot.jsp")); + } + else{ + request.setAttribute("message", "系统维护中,请稍后再试!"); + return (mapping.findForward("admin/hzp/hot.jsp")); + } + } + else if(method.equals("tejiadeltrave")){ + String id=request.getParameter("id").trim(); + int flag = tb.delTrave(id); + if(flag == Constant.SUCCESS){ + request.setAttribute("message", "操作成功!"); + return (mapping.findForward("admin/hzp/tejia.jsp")); + } + else{ + request.setAttribute("message", "系统维护中,请稍后再试!"); + return (mapping.findForward("admin/hzp/tejia.jsp")); + } + } + else if(method.equals("tuijiandeltrave")){ + String id=request.getParameter("id").trim(); + int flag = tb.delTrave(id); + if(flag == Constant.SUCCESS){ + request.setAttribute("message", "操作成功!"); + return (mapping.findForward("admin/hzp/tuijian.jsp")); + } + else{ + request.setAttribute("message", "系统维护中,请稍后再试!"); + return (mapping.findForward("admin/hzp/tuijian.jsp")); + } + } + + else if(method.equals("addType")){ + String type=request.getParameter("type").trim(); + int flag=tb.addType(type); + if(flag == Constant.SUCCESS){ + request.setAttribute("message", "操作成功!"); + return (mapping.findForward("admin/hzp/type.jsp")); + } + else if(flag==Constant.DEFAULT_ERROR){ + request.setAttribute("message", "该分类已存在!"); + return (mapping.findForward("admin/hzp/type.jsp")); + } + else{ + request.setAttribute("message", "系统维护中,请稍后再试!"); + return (mapping.findForward("admin/hzp/type.jsp")); + } + } + else if(method.equals("delType")){ + String id=request.getParameter("id").trim(); + int flag=tb.delType(id); + if(flag == Constant.SUCCESS){ + request.setAttribute("message", "操作成功!"); + return (mapping.findForward("admin/hzp/type.jsp")); + } + + else{ + request.setAttribute("message", "系统维护中,请稍后再试!"); + return (mapping.findForward("admin/hzp/type.jsp")); + } + } + + else{ + return (mapping.findForward("index.jsp")); + } + } +} \ No newline at end of file