PopegroupdelAction.java
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:2k
源码类别:

OA系统

开发平台:

Java

  1. package officeol.mc.actions;
  2. import org.apache.struts.action.ActionMapping;
  3. import org.apache.struts.action.ActionForm;
  4. import javax.servlet.http.HttpServletRequest;
  5. import javax.servlet.http.HttpServletResponse;
  6. import org.apache.struts.action.ActionForward;
  7. import org.apache.struts.action.Action;
  8. import java.io.UnsupportedEncodingException;
  9. import officeol.mc.tools.*;
  10. public class PopegroupdelAction extends Action {
  11.     public ActionForward execute(ActionMapping mapping, ActionForm form,
  12.                                  HttpServletRequest request,
  13.                                  HttpServletResponse response) {
  14.         try {
  15.             request.setCharacterEncoding("GBK");
  16.         } catch (UnsupportedEncodingException ex) {
  17.             ex.printStackTrace();
  18.         }
  19.         try {
  20.             String pgname = request.getParameter("pgname");
  21.             DBConn dbc = new DBConn();
  22.             if (!pgname.equals("")) {
  23.                 String sql = "delete from popedomgroup where popegroup='"+pgname+"'";
  24.                 dbc.executeUpdate(sql);
  25.                 System.out.println(sql);
  26.                 request.setAttribute("msg", "删除权限组" + pgname + "成功!");
  27.                 return mapping.findForward("succ");
  28.             } else {
  29.                 request.setAttribute("msg", "paname is null");
  30.                 return mapping.findForward("err");
  31.             }
  32.         } catch (Exception ex) {
  33.             ex.printStackTrace();
  34.             request.setAttribute("msg", "paname is null");
  35.         }
  36.         return mapping.findForward("err");
  37.     }
  38. }