Exemplo n.º 1
0
 public IStage getStage(DbCnt cnt, int stagePcdId) throws ISPACException {
   String sql = "WHERE ID_EXP = " + getInt(IDKEY) + " AND ID_FASE = " + stagePcdId;
   CollectionDAO objlist = new CollectionDAO(TXFaseDAO.class);
   objlist.query(cnt, sql);
   if (objlist.next()) return (IStage) objlist.value();
   return null;
 }
Exemplo n.º 2
0
  public IItemCollection getPermissions(int typeObject, int idObject, int[] typePermissions)
      throws ISPACException {
    CollectionDAO coldao =
        PermissionDAO.getPermissions(mDbCnt, typeObject, idObject, typePermissions);

    List list = new ArrayList();
    while (coldao.next()) {

      ObjectDAO permission = coldao.value();
      String respName = permission.getString("RESP_NAME");
      if (StringUtils.isBlank(respName)) {

        String idResp = permission.getString("ID_RESP");
        IResponsible responsible = null;

        try {
          responsible = getResp(idResp);
          // } catch (ISPACException ie) {
        } catch (Exception ie) {
          // java.lang.NumberFormatException
          // si el ID_RESP no es un UID y es el nombre del responsable
        }

        /*
        if (responsible != null) {

        	// Establecer el nombre del responsable
        	permission.set("RESP_NAME", responsible.getRespName());
        	permission.store(mDbCnt);
        } else {
        	// Eliminar el permiso asociado al responsable que ya no existe
        	// permission.delete(mDbCnt);
        	// No eliminar sino no incluirlo en la lista
        	permission = null;
        }
        */

        if (responsible != null) {
          // Establecer el nombre del responsable
          permission.set("RESP_NAME", responsible.getRespName());
          permission.store(mDbCnt);
        }
        /*else {
        	// Establecer el ID como nombre del responsable
        	permission.set("RESP_NAME", idResp);
        }
        permission.store(mDbCnt);
        */
      }

      if (permission != null) {
        list.add(permission);
      }
    }

    return new ListCollection(list);
  }
Exemplo n.º 3
0
  public IItemCollection getRespPermissions(int idpcd, int codePermission) throws ISPACException {
    CollectionDAO coldao = PermissionsDAO.getPermissions(mDbCnt, idpcd, codePermission);
    List list = new ArrayList();
    while (coldao.next()) {
      ObjectDAO dao = coldao.value();
      String uid = dao.getString("UID_USR");
      IResponsible resp = getResp(uid);
      list.add(resp);
    }

    return new ListCollection(list);
  }