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

📄 trnmngaction.java

📁 培训考试系统代码
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
      }
      else
      {
        req.setAttribute("errorId",ErrorCode.UNKNOW_ERROR);
        return (mapping.findForward("error"));
      }
      */
       req.setAttribute("successId",SuccessCode.TRNMNG_MOD);
       return (mapping.findForward("success"));
    }else
    {
       req.setAttribute("errorId",ErrorCode.TRNMNG_MOD);
       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();
          }
        }
    }
   /***
    * 按照培训档案ID删除课程培训档案
    */

 private  ActionForward delByLessonID(ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
     String operatorflag = ((TrnmngForm)form).getOperatorflag();
     //得到待删除的eduidarray 数组
     String lessonidarray[] = ((TrnmngForm)form).getLessonidarray();
     String staffno = ((TrnmngForm)form).getStaffno();
     //将数组中的每个字符串以#分割,赋给eduidstring
     String idstring = "";
     for (int i=0; i < lessonidarray.length ;i++)
     {
         if (idstring == "")
         {
             idstring = lessonidarray[i];
         }
         else
         {
             idstring = idstring + "#" + lessonidarray[i];
         }
     }
     SysDbConn aplcoms = null;
     try
     {
       //连接数据源
       aplcoms = SysConnPool.getInstance().getAplComs();
       aplcoms.preparedSP();
       //获得输入参数
       aplcoms.setString(1,idstring);
       aplcoms.setString(2,staffno);
       //if (调用存储过程 P_Agt_DelLessonArchiveByLessonID 删除教育经历档案记录成功)
       SysDataSet ds1 = aplcoms.csCommonSP("P_Agt_DelLeArByLessonID");
       SysRecord rc1 = ds1.getParamSet() ;
       if(rc1!=null && rc1.getInt(0) == 0)
       {
         ((TrnmngForm)form).setStaffno(staffno);
         ((TrnmngForm)form).setOperatorflag("TRNMNG_QUERYLESSONDETAIL");
         //调用 queryTrnArchive 查询

         return queryLessonArchive(mapping,form,req,res);
       }
       else if(rc1!=null && rc1.getInt(0) == 2) //未完全删除
       {
         //定位到错误叶面错误码为 errorcode.TRNMNG_DELUNCOMP
         req.setAttribute("errorId",ErrorCode.TRNMNG_DELUNCOMP);
         return(mapping.findForward("error"));
       }
       else
       {
        // 定位到错误页面错误码为 errorcode.TRNMNG_DEL
        req.setAttribute("errorId",ErrorCode.TRNMNG_DEL);
        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();
          }
        }
    }

   /***
    * 按照培训档案ID删除考试培训档案
    */

 private  ActionForward delByTestID(ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
     String operatorflag = ((TrnmngForm)form).getOperatorflag();
     //得到待删除的eduidarray 数组
     String testidarray[] = ((TrnmngForm)form).getTestidarray();
     String staffno = ((TrnmngForm)form).getStaffno();
     //将数组中的每个字符串以#分割,赋给eduidstring
     String idstring = "";
     for (int i=0; i < testidarray.length ;i++)
     {
         if (idstring == "")
         {
             idstring = testidarray[i];
         }
         else
         {
             idstring = idstring + "#" + testidarray[i];
         }
     }
     SysDbConn aplcoms = null;
     try
     {
       //连接数据源
       aplcoms = SysConnPool.getInstance().getAplComs();
       aplcoms.preparedSP();
       //获得输入参数
       aplcoms.setString(1,idstring);
       aplcoms.setString(2,staffno);
       //if (调用存储过程 P_Agt_DelTrnArchiveByTrainID 删除教育经历档案记录成功)
       SysDataSet ds1 = aplcoms.csCommonSP("P_Agt_DelTeArByTestID");
       SysRecord rc1 = ds1.getParamSet() ;
       if(rc1!=null && rc1.getInt(0) == 0)
       {
         ((TrnmngForm)form).setStaffno(staffno);
         ((TrnmngForm)form).setOperatorflag("TRNMNG_QUERYTESTDETAIL");
         //调用 queryTrnArchive 查询

         return queryTestArchive(mapping,form,req,res);
       }
       else if(rc1!=null && rc1.getInt(0) == 2) //未完全删除
       {
         //定位到错误叶面错误码为 errorcode.TRNMNG_DELUNCOMP
         req.setAttribute("errorId",ErrorCode.TRNMNG_DELUNCOMP);
         return(mapping.findForward("error"));
       }
       else
       {
        // 定位到错误页面错误码为 errorcode.TRNMNG_DEL
        req.setAttribute("errorId",ErrorCode.TRNMNG_DEL);
        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();
          }
        }
    }
   /***
    * 按照业务代表ID删除课程培训档案
    */

 private  ActionForward delLessonByStaff(ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
     String operatorflag = ((TrnmngForm)form).getOperatorflag();
     //得到待删除的eduidarray 数组
     String staffnoarray[] = ((TrnmngForm)form).getStaffnoarray();
     //将数组中的每个字符串以#分割,赋给eduidstring
     String staffnostring = "";
     for (int i=0; i < staffnoarray.length ;i++)
     {
         if(staffnostring == "")
         {
             staffnostring = staffnoarray[i];
         }
         else
         {
             staffnostring = staffnostring + "#" + staffnoarray[i];
         }
     }
     SysDbConn aplcoms = null;

     try
     {
       //连接数据源
       aplcoms = SysConnPool.getInstance().getAplComs();
       aplcoms.preparedSP();
       //获得输入参数
       aplcoms.setString(1,staffnostring);
       //if (调用存储过程 P_Agt_DelLessonArchiveByStaff 删除教育经历档案记录成功)
       SysDataSet ds1 = aplcoms.csCommonSP("P_Agt_DelLeArByStaff");
       SysRecord rc1 = ds1.getParamSet() ;
       if(rc1!=null && rc1.getInt(0) == 0)
       {
         //调用 queryEduList 查询
         return queryLessonStaffList(mapping,form,req,res);
       }
       else if(rc1!=null && rc1.getInt(0) == 2) //未完全删除
       {
         //定位到错误叶面错误码为 errorcode.TRNMNG_DELBYSTAFFUNCOMP
         req.setAttribute("errorId",ErrorCode.TRNMNG_DELBYSTAFFUNCOMP);
         return(mapping.findForward("error"));
       }
       else
        // 定位到错误页面错误码为 errorcode.TRNMNG_DELBYSTAFF
        req.setAttribute("errorId",ErrorCode.TRNMNG_DELBYSTAFF);
        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();
          }
        }
    }


   /***
    * 按照业务代表ID删除考试培训档案
    */

 private  ActionForward delTestByStaff(ActionMapping mapping,
       ActionForm form, HttpServletRequest req,
        HttpServletResponse res)
    {
     String operatorflag = ((TrnmngForm)form).getOperatorflag();
     //得到待删除的eduidarray 数组
     String staffnoarray[] = ((TrnmngForm)form).getStaffnoarray();
     //将数组中的每个字符串以#分割,赋给eduidstring
     String staffnostring = "";
     for (int i=0; i < staffnoarray.length ;i++)
     {
         if(staffnostring == "")
         {
             staffnostring = staffnoarray[i];
         }
         else
         {
             staffnostring = staffnostring + "#" + staffnoarray[i];
         }
     }
     SysDbConn aplcoms = null;

     try
     {
       //连接数据源
       aplcoms = SysConnPool.getInstance().getAplComs();
       aplcoms.preparedSP();
       //获得输入参数
       aplcoms.setString(1,staffnostring);
       //if (调用存储过程 P_Agt_DelTestArchiveByStaff 删除教育经历档案记录成功)
       SysDataSet ds1 = aplcoms.csCommonSP("P_Agt_DelTeArByStaff");
       SysRecord rc1 = ds1.getParamSet() ;
       if(rc1!=null && rc1.getInt(0) == 0)
       {
         //调用 queryEduList 查询
         return queryTestStaffList(mapping,form,req,res);
       }
       else if(rc1!=null && rc1.getInt(0) == 2) //未完全删除
       {
         //定位到错误叶面错误码为 errorcode.TRNMNG_DELBYSTAFFUNCOMP
         req.setAttribute("errorId",ErrorCode.TRNMNG_DELBYSTAFFUNCOMP);
         return(mapping.findForward("error"));
       }
       else
        // 定位到错误页面错误码为 errorcode.TRNMNG_DELBYSTAFF
        req.setAttribute("errorId",ErrorCode.TRNMNG_DELBYSTAFF);
        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 + -