⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ruleaction.java

📁 培训考试系统代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
    String trainratio = ((RuleForm)form).getTrainratio();
    String methodid = ((RuleForm)form).getMethodid();
    SysDbConn aplcoms = null;
    try
   {
      //连接数据源
      aplcoms = SysConnPool.getInstance().getAplComs();
      aplcoms.preparedSP();
      //获得参数
      aplcoms.setString(1 ,ruletitle);
      aplcoms.setString(2 ,rulenote);
      aplcoms.setString(3 ,dutyratio);
      aplcoms.setString(4 ,workratio);
      aplcoms.setString(5 ,handleratio);
      aplcoms.setString(6 ,qcratio);
      aplcoms.setString(7 ,monitorratio);
      aplcoms.setString(8 ,visitratio);
      aplcoms.setString(9 ,trainratio);
      aplcoms.setString(10 ,methodid);
      //调用P_Agt_AddRule新增记录
      SysDataSet ds = aplcoms.csCommonSP("P_Agt_AddRule");
      SysRecord rc = ds.getParamSet();
      if (rc!=null && rc.getInt(0) == 0)
      {
          //((RuleForm)form).setOperatorflag("RULE_QUERYDETAIL");
          //((RuleForm)form).setRuleid(rc.getString(1));
          //return queryRuleDetail(mapping,form,req,res);
          req.setAttribute("successId",SuccessCode.SYNEVA_RULEADD);
          return (mapping.findForward("success"));
      }
      else
      {
          req.setAttribute("errorId",ErrorCode.SYNEVA_RULEADD);
          return (mapping.findForward("error"));
      }
   }catch (SysDbException aple)
      {
        //捕获CommonService系统异常,定向到出错页面,错误码为ErrorCode.COMMONSERVICE_ERROR
          aple.printStackTrace();
          req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(java.sql.SQLException sqle)
      {
        //捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
          sqle.printStackTrace();
          req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(Exception e)
      {
        //捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR
          e.printStackTrace();
          req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
          return (mapping.findForward("error"));
       }
      finally
        //关闭连接实例
        {
          if(aplcoms != null)
          {
             aplcoms.close();
          }
        }
    }
        /****************************************************
         *修改综合考评规则
         ****************************************************/

       private ActionForward modRule (ActionMapping mapping,
        ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
        //得到输入参数
    String operatorflag = ((RuleForm)form).getOperatorflag();
    String ruleid =((RuleForm)form).getRuleid();
    String ruletitle = ((RuleForm)form).getRuletitle();
    String rulenote = ((RuleForm)form).getRulenote();
    String dutyratio = ((RuleForm)form).getDutyratio();
    String workratio = ((RuleForm)form).getWorkratio();
    String handleratio = ((RuleForm)form).getHandleratio() ;
    String qcratio = ((RuleForm)form).getQcratio();
    String monitorratio = ((RuleForm)form).getMonitorratio();
    String visitratio = ((RuleForm)form).getVisitratio();
    String trainratio = ((RuleForm)form).getTrainratio();
    String methodid = ((RuleForm)form).getMethodid();
    SysDbConn aplcoms = null;
    try
   {
      //连接数据源
      aplcoms = SysConnPool.getInstance().getAplComs();
      aplcoms.preparedSP();
      //获得参数
      aplcoms.setString(1 ,ruletitle);
      aplcoms.setString(2 ,rulenote);
      aplcoms.setString(3 ,dutyratio);
      aplcoms.setString(4 ,workratio);
      aplcoms.setString(5 ,handleratio);
      aplcoms.setString(6 ,qcratio);
      aplcoms.setString(7 ,monitorratio);
      aplcoms.setString(8 ,visitratio);
      aplcoms.setString(9 ,trainratio);
      aplcoms.setString(10 ,methodid);
      aplcoms.setString(11 ,ruleid);

      //调用P_Agt_UpdateRule修改记录
      SysDataSet ds = aplcoms.csCommonSP("P_Agt_UpdateRule");
      SysRecord rc = ds.getParamSet();
      if (rc!=null && rc.getInt(0) == 0)
      {
          //((RuleForm)form).setOperatorflag("RULE_QUERYDETAIL");
          //((RuleForm)form).setRuleid(ruleid);
          //return queryRuleDetail(mapping,form,req,res);
          req.setAttribute("successId",SuccessCode.SYNEVA_RULEMOD);
          return (mapping.findForward("success"));

      }else
      {
          req.setAttribute("errorId",ErrorCode.SYNEVA_RULEMOD);
          return (mapping.findForward("error"));
      }
   }catch (SysDbException aple)
      {
        //捕获CommonService系统异常,定向到出错页面,错误码为ErrorCode.COMMONSERVICE_ERROR
          aple.printStackTrace();
          req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(java.sql.SQLException sqle)
      {
        //捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
          sqle.printStackTrace();
          req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(Exception e)
      {
        //捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR
          e.printStackTrace();
          req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
          return (mapping.findForward("error"));
       }
      finally
        //关闭连接实例
        {
          if(aplcoms != null)
          {
             aplcoms.close();
          }
        }
    }
   /***
    * 删除培训教师档案
    */

 private  ActionForward delRule(ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
     String operatorflag = ((RuleForm)form).getOperatorflag();

     //得到待删除的eduidarray 数组
     String idarray[] = ((RuleForm)form).getRuleidarray();
     //将数组中的每个字符串以#分割,赋给idstring
     String idstring = "";
     for (int i=0; i < idarray.length ;i++)
     {
         if (idstring == "")
         {
             idstring = idarray[i];
         }
         else
         {
             idstring = idstring + "#" + idarray[i];
         }
     }
     SysDbConn aplcoms = null;

     try
     {
       //连接数据源
       aplcoms = SysConnPool.getInstance().getAplComs();
       aplcoms.preparedSP();
       //获得输入参数
       aplcoms.setString(1,idstring);
       //if (调用存储过程 P_Agt_DelTeacherArchive 删除教师档案记录成功)
       SysDataSet ds1 = aplcoms.csCommonSP("P_Agt_DelRule");
       SysRecord rc1 = ds1.getParamSet() ;
       if(rc1!=null && rc1.getInt(0) == 0)
       {
         //调用 queryRuleList 查询
         return queryRuleList(mapping,form,req,res);
       }
       else if(rc1!=null && rc1.getInt(0) == 2) //未完全删除
       {
         //定位到错误叶面错误码为 errorcode.SYNEVA_RULEDELUNCOMP
         req.setAttribute("errorId",ErrorCode.SYNEVA_RULEDELUNCOMP);
         return(mapping.findForward("error"));
       }
       else
        // 定位到错误页面错误码为 errorcode.SYNEVA_RULEDEL
        req.setAttribute("errorId",ErrorCode.SYNEVA_RULEDEL);
        return (mapping.findForward("error"));
      }
      catch (SysDbException aple)
      {
        //捕获CommonService系统异常,定向到出错页面,错误码为ErrorCode.COMMONSERVICE_ERROR
          aple.printStackTrace();
          req.setAttribute("errorId",ErrorCode.COMMONSERVICE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(java.sql.SQLException sqle)
      {
        //捕获调用aplcoms异常,定向到出错页面,错误码为ErrorCode.DATABASE_ERROR
          sqle.printStackTrace();
          req.setAttribute("errorId",ErrorCode.DATABASE_ERROR);
          return (mapping.findForward("error"));
       }
      catch(Exception e)
      {
        //捕获未知异常,定向到出错页面,错误码为ErrorCode.UNKNOW_ERROR
          e.printStackTrace();
          req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
          return (mapping.findForward("error"));
       }
      finally
        //关闭连接实例
        {
          if(aplcoms != null)
          {
             aplcoms.close();
          }
        }
    }


}

⌨️ 快捷键说明

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