/// <summary>
 /// 获取模型对应数据库表名
 /// </summary>
 /// <returns></returns>
 protected static string GLB_GetDBTableName(System.Type type)
 {
     if (GLB_CACHE_MODELPROPERTYS.ContainsKey(type))
     {
         return(GLB_CACHE_MODELPROPERTYS[type].TableName);
     }
     else
     {
         return(GetPropertyTableName(type));
     }
 }
        /// <summary>
        /// 装载模型属性
        /// </summary>
        /// <param name="type"></param>
        /// <param name="funcEach"></param>
        /// <param name="funcIgnore"></param>
        private static Cache_ModelInfor LoadModelProperty(Type type, Action <Cache_ModelInfor_Property> funcEach, Func <Cache_ModelInfor_Property, bool> funcIgnore)
        {
            if (GLB_CACHE_MODELPROPERTYS.ContainsKey(type))
            {
                Cache_ModelInfor cminfo = GLB_CACHE_MODELPROPERTYS[type];
                List <Cache_ModelInfor_Property> t_props = cminfo.PropertyInfoList;
                foreach (Cache_ModelInfor_Property pi in t_props)
                {
                    if (!funcIgnore(pi))
                    {
                        funcEach(pi);
                    }
                }
                return(cminfo);
            }
            else
            {
                List <Cache_ModelInfor_Property> t_props;
                t_props = new List <Cache_ModelInfor_Property>();
                string
                    fieldname,
                    pkname   = string.Empty,
                    pksqlexp = string.Empty;
                bool b_pkint = false;
                Cache_ModelInfor_Property porpinfor;
                PropertyInfo        prop_idf = null, prop_pk = null;
                ModelFieldAttribute attr;
                PropertyInfo[]      props = type.GetProperties();
                foreach (PropertyInfo p in props)
                {
                    if (p.CanWrite)
                    {
                        #region 属性处理
                        object[] attrs = p.GetCustomAttributes(false);
                        if (attrs.Length > 0)
                        {
                            attr = (ModelFieldAttribute)attrs[0];
                            // 直接忽略
                            if (attr.Ignore)
                            {
                                continue;
                            }
                            // 获取自定义字段名
                            if (string.IsNullOrEmpty(attr.FieldName))
                            {
                                fieldname = p.Name;
                            }
                            else
                            {
                                fieldname = attr.FieldName;
                            }
                            // 获取自增键
                            if (attr.IdentityKey)
                            {
                                prop_idf = p;
                            }
                            // 获取主键
                            if (attr.PrimaryKey)
                            {
                                prop_pk = p;
                                pkname  = fieldname;
                                // 主键仅识别字符串类型和非字符串类型
                                if (p.PropertyType == typeof(string))
                                {
                                    pksqlexp = pkname + "='{0}'";
                                }
                                else
                                {
                                    b_pkint  = true;
                                    pksqlexp = pkname + "={0}";
                                }
                            }
                        }
                        else
                        {
                            fieldname = p.Name;
                            attr      = null;
                        }
                        #endregion
                        porpinfor = new Cache_ModelInfor_Property
                        {
                            FieldName         = fieldname,
                            Property          = p,
                            PropertyModelAttr = attr
                        };

                        t_props.Add(porpinfor);

                        try
                        {
                            if (!funcIgnore(porpinfor))
                            {
                                funcEach(porpinfor);
                            }
                        }
                        catch
                        {
                        }
                    }
                }
                string           key_tablename = GLB_GetDBTableName(type);
                Cache_ModelInfor r             = new Cache_ModelInfor
                {
                    TableName                     = key_tablename,
                    PrimaryKeyProperty            = prop_pk,
                    PrimaryKeyFieldName           = pkname,
                    PrimaryKeySQLConditionExpress = pksqlexp,
                    IdentityProperty              = prop_idf,
                    PropertyInfoList              = t_props,
                    IsIntPrimaryKey               = b_pkint
                };
                GLB_CACHE_MODELPROPERTYS.Add(type, r);
                return(r);
            }
        }