Показать сообщение отдельно
Старый 24.10.2007, 20:47   #7  
kashperuk is offline
kashperuk
Участник
Аватар для kashperuk
MCBMSS
Соотечественники
Сотрудники Microsoft Dynamics
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии 2011
Лучший по профессии 2009
 
4,361 / 2084 (78) +++++++++
Регистрация: 30.05.2004
Адрес: Atlanta, GA, USA
Можно
X++:
// If '_mapField' and '_tableField' are empty:     true if the '_mapId' map have a mapping for table '_tableId'
// If '_mapField' is not empty:                    true if the '_mapId' map have a mapping for it's field '_mapField' for table '_tableId'
// If '_tableField' is not empty:                  true if the '_mapId' map have a mapping for table's field '_tableField' for table '_tableId'
// If '_mapField' and '_tableField' are not empty: true if '_mapField' is a mapping for '_tableField' on map '_mapId' for table '_tableId'
static public boolean mappingExists_RU(tableId _mapId,
                                tableId _tableId,
                                fieldId _mapField   = 0,
                                fieldId _tableField = 0)
{
    boolean          ok;
    Map              map = MappingsInfo_RU::createMapWithFieldId( _tableId, _mapId);
    identifiername   fieldName;

    ;

    if (! map.empty())
    {
        if (_mapField || _tableField)
        {
            if (_mapField && _tableField)
            {
                fieldName = fieldid2name(_mapId, _mapField);

                if (map.exists(fieldName) && (map.lookup(fieldName) == _tableField))
                {
                    ok = true;
                }
            }
            else if (_mapField)
            {
                if (map.keySet().in(fieldid2name(_mapId, _mapField)))
                {
                    ok = true;
                }
            }
            else if (_tableField)
            {
                if (map.valueSet().in(_tableField))
                {
                    ok = true;
                }
            }
        }
        else
        {
            ok = true;
        }
    }

    return ok;
}
За это сообщение автора поблагодарили: Hyper (1).