Display cu map

Lasă un comentariu

18 Mai 2010 de liviustoica55


public void cursorNotify(int _event)
{
    LedgerTable ledgerTableCache;
    Map         mapLedgerTable;
    container   conMapHasDimensionSetForcedDimension;
    container   conMapBalances;
    ;

    super(_event);

    if (_event == 0 || _event == 1)
    {
        ledgerTableCache = ledgerTable_ds.getFirst(0,false);
        while (ledgerTableCache)
        {
            if (!mapHasDimensionSetForcedDimension.exists(ledgerTableCache.RecId) ||
                (ledgerBalance && !mapBalances.exists(ledgerTableCache.AccountNum)))
            {
                if (!mapLedgerTable)
                    mapLedgerTable = new Map(typeId2Type(typeid(recId)), Types::Record);

                mapLedgerTable.insert(ledgerTableCache.RecId, ledgerTableCache);
            }

            ledgerTableCache = ledgerTable_ds.getNext();
        }

        if (mapLedgerTable)
        {
            [conMapHasDimensionSetForcedDimension, conMapBalances] =
                LedgerTable::ledgerTableDisplayCache(mapLedgerTable.pack(),
                mapHasDimensionSetForcedDimension.pack(),
                mapBalances.pack(),
                ledgerBalance);
        }

        if (conMapHasDimensionSetForcedDimension)
        {
            mapHasDimensionSetForcedDimension = Map::create(conMapHasDimensionSetForcedDimension);
        }

        if (conMapBalances)
        {
            mapBalances = Map::(conMapBalances);
        }
    }
}
//BP Deviation Documented
display AmountMST accountBalance(LedgerTable _ledgerTable)
{
    AmountMST   balance;
    ;

    if (!hasSecuritykeyAccess(securitykeynum(LedgerMisc), AccessType::View))
        return balance;

    if (!hasFieldAccess(tablenum(LedgerBalancesDimTrans), fieldnum(LedgerBalancesDimTrans, DebitMST)) ||
        !hasFieldAccess(tablenum(LedgerBalancesDimTrans), fieldnum(LedgerBalancesDimTrans, CreditMST)))
    {
        return balance;
    }

    if (ledgerBalance)
    {
        if (!mapBalances.exists(_ledgerTable.AccountNum))
        {
            mapBalances.insert(_ledgerTable.AccountNum, _ledgerTable.ledgerTableDisplayCacheCalcBalance(ledgerBalance));
        }

        balance = mapBalances.lookup(_ledgerTable.AccountNum);
    }

    return balance;
}
 mapBalances = new Map(Types::String, Types::Real);

Lasă un răspuns

Completează mai jos detaliile despre tine sau dă clic pe un icon pentru autentificare:

Logo WordPress.com

Comentezi folosind contul tău WordPress.com. Dezautentificare / Schimbă )

Poză Twitter

Comentezi folosind contul tău Twitter. Dezautentificare / Schimbă )

Fotografie Facebook

Comentezi folosind contul tău Facebook. Dezautentificare / Schimbă )

Fotografie Google+

Comentezi folosind contul tău Google+. Dezautentificare / Schimbă )

Conectare la %s

%d blogeri au apreciat asta: