UserPopeAddAction.java~14~
资源名称:bangong.rar [点击查看]
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:2k
源码类别:
OA系统
开发平台:
Java
- package officeol.mc.actions;
- 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 org.apache.struts.action.Action;
- import officeol.mc.tools.*;
- public class UserPopeAddAction extends Action {
- public ActionForward execute(ActionMapping mapping, ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) {
- try{
- request.setCharacterEncoding("GBK");
- String ug = request.getParameter("ug");
- String pg = request.getParameter("pg");
- String sm = request.getParameter("sm");
- String isql = "insert into groupmanage (usergroup,popegroup,shuoming) values('"+
- ug+"','"+pg+"','"+sm+"')";
- DBConn dbc = new DBConn();
- String csql = "select * from groupmanage where usergroup='"+
- ug+"' and popegroup = '"+pg+"'";
- System.out.println(csql);
- if(dbc.getArray(csql)==null){
- System.out.println(isql);
- dbc.executeUpdate(isql);
- request.setAttribute("msg", "添加成功!");
- }else{
- request.setAttribute("msg","该用户组已经有权限,不需要再添加!");
- }
- }catch(Exception ex){
- ex.printStackTrace();
- request.setAttribute("msg","添加出现异常,请重试!");
- }
- return mapping.findForward("succ");
- }
- }