//Return the top extendtypeid,If error,return ''
static ExtendedDataTypeName GetFinalExtendedType(TableId _tableId,FieldId _fieldId)
{
SysDictField dictField;
SysDictType dictType;
ExtendedTypeId tmpExtendTypeId;
ExtendedTypeId finalExtendTypeId;
ExtendedTypeId getNextExtendedTypeId(DictType _dictType)
{
;
if(_dictType.extend())
return _dictType.extend();
else
return 0;
}
;
if(_tableId && _fieldId)
dictField = new SysDictField(_tableId,_fieldId);
else
return '';
dictType = new SysDictType(dictField.typeId());
if(!dictType)
return '';
finalExtendTypeId = dictType.id();
while(true)
{
tmpExtendTypeId = getNextExtendedTypeId(dictType);
//if not '',find next extendTypeId
if(tmpExtendTypeId)
{
finalExtendTypeId = tmpExtendTypeId;
dictType = new DictType(finalExtendTypeId);
}
else
break;
}
if(finalExtendTypeId)
return new dictType(finalExtendTypeId).Name();
else
return '';
}
static ExtendedDataTypeName GetFinalExtendedType(TableId _tableId,FieldId _fieldId)
{
SysDictField dictField;
SysDictType dictType;
ExtendedTypeId tmpExtendTypeId;
ExtendedTypeId finalExtendTypeId;
ExtendedTypeId getNextExtendedTypeId(DictType _dictType)
{
;
if(_dictType.extend())
return _dictType.extend();
else
return 0;
}
;
if(_tableId && _fieldId)
dictField = new SysDictField(_tableId,_fieldId);
else
return '';
dictType = new SysDictType(dictField.typeId());
if(!dictType)
return '';
finalExtendTypeId = dictType.id();
while(true)
{
tmpExtendTypeId = getNextExtendedTypeId(dictType);
//if not '',find next extendTypeId
if(tmpExtendTypeId)
{
finalExtendTypeId = tmpExtendTypeId;
dictType = new DictType(finalExtendTypeId);
}
else
break;
}
if(finalExtendTypeId)
return new dictType(finalExtendTypeId).Name();
else
return '';
}
附件是测试用例。