Search in sources :

Example 1 with V_stm_paramin_sing_contoBulk

use of it.cnr.contab.doccont00.singconto.bulk.V_stm_paramin_sing_contoBulk in project sigla-main by consiglionazionaledellericerche.

the class StampaSingoloContoComponent method associaTutti.

/**
 * associaTutti method comment.
 */
public void associaTutti(it.cnr.jada.UserContext userContext, it.cnr.contab.doccont00.singconto.bulk.V_voce_f_sing_contoBulk filtro, java.math.BigDecimal pg_stampa) throws ComponentException {
    try {
        annullaModificaSelezione(userContext, filtro);
        BigDecimal currentSequence = Utility.ZERO;
        V_voce_f_sing_contoHome home = (V_voce_f_sing_contoHome) getHome(userContext, V_voce_f_sing_contoBulk.class);
        SQLBuilder query = home.createSQLBuilder();
        query.addClause(filtro.getSqlClauses());
        for (Iterator righe = home.fetchAll(query).iterator(); righe.hasNext(); ) {
            V_voce_f_sing_contoBulk voce_f_sing_conto = (V_voce_f_sing_contoBulk) righe.next();
            V_stm_paramin_sing_contoBulk singoloConto = new V_stm_paramin_sing_contoBulk(voce_f_sing_conto);
            singoloConto.setUser(it.cnr.contab.utenze00.bp.CNRUserContext.getUser(userContext));
            singoloConto.setId_report(pg_stampa);
            singoloConto.setChiave(pg_stampa.toString());
            currentSequence = currentSequence.add(new java.math.BigDecimal(1));
            singoloConto.setSequenza(currentSequence);
            if (voce_f_sing_conto.getFl_partita_giro() != null && voce_f_sing_conto.getFl_partita_giro().booleanValue()) {
                singoloConto.setCd_cds(it.cnr.contab.utenze00.bp.CNRUserContext.getCd_cds(userContext));
            }
            insertBulk(userContext, singoloConto);
        }
    } catch (Throwable t) {
        throw handleException(filtro, t);
    }
}
Also used : SQLBuilder(it.cnr.jada.persistency.sql.SQLBuilder) V_stm_paramin_sing_contoBulk(it.cnr.contab.doccont00.singconto.bulk.V_stm_paramin_sing_contoBulk) V_voce_f_sing_contoBulk(it.cnr.contab.doccont00.singconto.bulk.V_voce_f_sing_contoBulk) Iterator(java.util.Iterator) V_voce_f_sing_contoHome(it.cnr.contab.doccont00.singconto.bulk.V_voce_f_sing_contoHome) BigDecimal(java.math.BigDecimal)

Example 2 with V_stm_paramin_sing_contoBulk

use of it.cnr.contab.doccont00.singconto.bulk.V_stm_paramin_sing_contoBulk in project sigla-main by consiglionazionaledellericerche.

the class StampaSingoloContoComponent method modificaSelezione.

/**
 * modificaSelezione method comment.
 */
public java.math.BigDecimal modificaSelezione(it.cnr.jada.UserContext userContext, it.cnr.contab.doccont00.singconto.bulk.V_voce_f_sing_contoBulk filtro, it.cnr.jada.bulk.OggettoBulk[] bulks, java.util.BitSet oldSelection, java.util.BitSet newSelection, java.math.BigDecimal pg_stampa, java.math.BigDecimal currentSequence) throws it.cnr.jada.comp.ComponentException {
    try {
        if (pg_stampa == null || currentSequence == null)
            throw new ApplicationException("Impossibile ottenere un id report!");
        // lockBulk(userContext,tipo_la);
        for (int i = 0; i < bulks.length; i++) {
            V_voce_f_sing_contoBulk voceF = (V_voce_f_sing_contoBulk) bulks[i];
            V_stm_paramin_sing_contoBulk singoloConto = new V_stm_paramin_sing_contoBulk(voceF);
            singoloConto.setUser(it.cnr.contab.utenze00.bp.CNRUserContext.getUser(userContext));
            singoloConto.setId_report(pg_stampa);
            singoloConto.setChiave(pg_stampa.toString());
            if (voceF.getFl_partita_giro() != null && voceF.getFl_partita_giro().booleanValue()) {
                singoloConto.setCd_cds(it.cnr.contab.utenze00.bp.CNRUserContext.getCd_cds(userContext));
            }
            if (oldSelection.get(i) != newSelection.get(i)) {
                if (newSelection.get(i)) {
                    singoloConto.setSequenza(currentSequence);
                    currentSequence = currentSequence.add(new java.math.BigDecimal(1));
                    insertBulk(userContext, singoloConto);
                } else {
                    deleteBulk(userContext, singoloConto);
                }
            }
        }
        return currentSequence;
    } catch (it.cnr.jada.persistency.PersistencyException e) {
        throw handleException(e);
    }
}
Also used : PersistencyException(it.cnr.jada.persistency.PersistencyException) ApplicationException(it.cnr.jada.comp.ApplicationException) V_stm_paramin_sing_contoBulk(it.cnr.contab.doccont00.singconto.bulk.V_stm_paramin_sing_contoBulk) V_voce_f_sing_contoBulk(it.cnr.contab.doccont00.singconto.bulk.V_voce_f_sing_contoBulk) BigDecimal(java.math.BigDecimal)

Aggregations

V_stm_paramin_sing_contoBulk (it.cnr.contab.doccont00.singconto.bulk.V_stm_paramin_sing_contoBulk)2 V_voce_f_sing_contoBulk (it.cnr.contab.doccont00.singconto.bulk.V_voce_f_sing_contoBulk)2 BigDecimal (java.math.BigDecimal)2 V_voce_f_sing_contoHome (it.cnr.contab.doccont00.singconto.bulk.V_voce_f_sing_contoHome)1 ApplicationException (it.cnr.jada.comp.ApplicationException)1 PersistencyException (it.cnr.jada.persistency.PersistencyException)1 SQLBuilder (it.cnr.jada.persistency.sql.SQLBuilder)1 Iterator (java.util.Iterator)1