jinyongaction.java~29~

来自「Bug管理系统」· JAVA~29~ 代码 · 共 44 行

JAVA~29~
44
字号
package tmp;

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 db.Db;
import  java.sql.*;

public class jinyongAction extends Action {
    public ActionForward execute(ActionMapping actionMapping,
                                 ActionForm actionForm,
                                 HttpServletRequest servletRequest,
                                 HttpServletResponse servletResponse)throws Exception {
        jinyongActionForm f = (jinyongActionForm) actionForm;
        //获取用户id 和 操作值 以及系统权限
        String jinyongzhi=f.getJinyongzhi();
        String yonghuid=f.getYonghuid();
        String xitongquanxian=f.getXitongquanxian();

        jinyongzhi = new String(jinyongzhi.getBytes("ISO-8859-1"), "gbk");
        yonghuid = new String(yonghuid.getBytes("ISO-8859-1"), "gbk");
        xitongquanxian = new String(xitongquanxian.getBytes("ISO-8859-1"), "gbk");

        //连接数据库
        Db db1 = new Db();
        db1.getCon("bugBarrier");

        String s="";
        if(jinyongzhi.equals("禁用该帐户"))
            s="update yonghu set jinyong=0 where yonghuid='"+yonghuid+"'";
        else
            s="update yonghu set jinyong=1 where yonghuid='"+yonghuid+"'";
        //权限修改
        Statement stmt = db1.conn.createStatement();
        stmt.execute(s); //执行
        db1.closeConnection();

        return actionMapping.findForward("tishixinxi");
    }
}

⌨️ 快捷键说明

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