zoukankan      html  css  js  c++  java
  • 获取最根级EDT类型名称

    有时候需要修改某个扩展数据类型的属性,比如字段的长度等,这些属性只能在最根级的EDT类型上修改,所以需要找到最根级的EDT类型,这个小例子演示了如何根据当前表的字段获取其对应的最根级EDT类型。
    //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 '';

    }

    附件是测试用例。
  • 相关阅读:
    简单区分Vmware的三种网络连接模式(bridged、NAT、host-only)
    linux创建账户并自动生成主目录和主目录下的文件
    EF 通用数据层类
    html在线美化网站
    图片在页面中居中显示
    __dopostback的用法
    rdlc报表集锦
    .NET开源免费的功能强大控件库
    使用webclient上传下载实例
    消息队列将并发变串行
  • 原文地址:https://www.cnblogs.com/Farseer1215/p/885454.html
Copyright © 2011-2022 走看看