예제 #1
0
 @Override
 public ArrayList<TareaBean> getPage(
     int intRegsPerPag,
     int intPage,
     ArrayList<FilterBeanHelper> hmFilter,
     HashMap<String, String> hmOrder,
     Integer expand)
     throws Exception {
   strSQL += SqlBuilder.buildSqlWhere(hmFilter);
   strSQL += SqlBuilder.buildSqlOrder(hmOrder);
   strSQL += SqlBuilder.buildSqlLimit(oMysql.getCount(strSQL), intRegsPerPag, intPage);
   ArrayList<TareaBean> arrTarea = new ArrayList<>();
   try {
     ResultSet oResultSet = oMysql.getAllSql(strSQL);
     if (oResultSet != null) {
       while (oResultSet.next()) {
         TareaBean oTareaBean = new TareaBean();
         arrTarea.add(oTareaBean.fill(oResultSet, oConnection, expand));
       }
     }
   } catch (Exception ex) {
     ExceptionBooster.boost(
         new Exception(this.getClass().getName() + ":getPage ERROR: " + ex.getMessage()));
   }
   return arrTarea;
 }
예제 #2
0
 public ArrayList<TareaBean> getAllTareaXCurso(Integer intTarea, Integer expand) throws Exception {
   strSQL += " AND tarea.id_asignaturaevaluacion = " + intTarea;
   ArrayList<TareaBean> arrTarea = new ArrayList<>();
   try {
     ResultSet oResultSet = oMysql.getAllSql(strSQL);
     if (oResultSet != null) {
       while (oResultSet.next()) {
         TareaBean oTareaBean = new TareaBean();
         arrTarea.add(oTareaBean.fill(oResultSet, oConnection, expand));
       }
     }
   } catch (Exception ex) {
     ExceptionBooster.boost(
         new Exception(this.getClass().getName() + ":getPage ERROR: " + ex.getMessage()));
   }
   return arrTarea;
 }
예제 #3
0
 @Override
 public TareaBean get(TareaBean oTareaBean, Integer expand) throws Exception {
   if (oTareaBean.getId() > 0) {
     try {
       ResultSet oResultSet = oMysql.getAllSql(strSQL + " And id= " + oTareaBean.getId() + " ");
       if (oResultSet != null) {
         while (oResultSet.next()) {
           oTareaBean = oTareaBean.fill(oResultSet, oConnection, expand);
         }
       }
     } catch (Exception ex) {
       ExceptionBooster.boost(
           new Exception(this.getClass().getName() + ":get ERROR: " + ex.getMessage()));
     }
   } else {
     oTareaBean.setId(0);
   }
   return oTareaBean;
 }
예제 #4
0
  @Override
  public Integer set(TareaBean oTareaBean) throws Exception {
    Integer iResult = null;
    try {
      if (oTareaBean.getId() == 0) {
        strSQL = "INSERT INTO " + strTable + " ";
        strSQL += "(" + oTareaBean.getColumns() + ")";
        strSQL += "VALUES(" + oTareaBean.getValues() + ")";
        iResult = oMysql.executeInsertSQL(strSQL);
      } else {
        strSQL = "UPDATE " + strTable + " ";
        strSQL += " SET " + oTareaBean.toPairs();
        strSQL += " WHERE id=" + oTareaBean.getId();
        iResult = oMysql.executeUpdateSQL(strSQL);
      }

    } catch (Exception ex) {
      ExceptionBooster.boost(
          new Exception(this.getClass().getName() + ":set ERROR: " + ex.getMessage()));
    }
    return iResult;
  }