public HField(string key, HFieldType hFieldType, uint minLength, uint maxLength)
 {
     Key       = key;
     HType     = hFieldType;
     MinLength = minLength;
     MaxLength = maxLength;
 }
示例#2
0
        /// <summary>
        /// 从文本中添加字段
        /// </summary>
        /// <param name="cells"></param>
        private void AddFieldByText(string[] cells)
        {
            HField Entity = new HField();

            Entity.CHName = cells[0];
            Entity.ENName = cells[1];

            string strType = cells[2];

            strType = strType.ToUpper();
            HFieldType type = HFieldType.NVARCHAR2;

            if (strType.Contains("NUMBER") || strType.Contains("COUNTER"))
            {
                type = HFieldType.NUMBER;
            }
            else if (strType.Contains("NVARCHAR2") || strType.Contains("TEXT") || strType.Contains("MEMO"))
            {
                type = HFieldType.NVARCHAR2;
            }
            else if (strType.Contains("DATE") || strType.Contains("DATETIME"))
            {
                type = HFieldType.DATE;
            }
            else if (strType.Contains("FLOAT"))
            {
                type = HFieldType.FLOAT;
            }
            else if (strType.Contains("INTEGER"))
            {
                type = HFieldType.INT;
            }
            else if (strType.Contains("CLOB"))
            {
                type = HFieldType.CLOB;
            }
            else if (strType.Contains("VARBINARY"))
            {
                type = HFieldType.BINARY;
            }
            Entity.Type = type;

            if (cells.Length >= 4)
            {
                string strLength = cells[3];
                int    length    = 0;
                if (!string.IsNullOrEmpty(strLength) && int.TryParse(strLength, out length) == true)
                {
                    Entity.Length = length;
                }
            }

            m_Datas.Add(Entity);
        }