Exemplo n.º 1
0
        private static string ResolveClassFiled(SqlDataBaseService.objectUlits.ClassFiledInfo classFiled)
        {
            StringBuilder builder;
            bool          flag;
            bool          flag2;
            string        str;
            bool          flag3;
            bool          flag4;

            builder = new StringBuilder(classFiled.ColunmName);
            builder.Append(" " + classFiled.Column_type);
            if ((classFiled.DataLength > 0) == null)
            {
                goto Label_0054;
            }
            builder.Append("(" + ((int)classFiled.DataLength) + ")");
Label_0054:
            if (classFiled.IsPk == null)
            {
                goto Label_0074;
            }
            builder.Append(" PRIMARY KEY");
            str = builder.ToString();
            goto Label_00E4;
Label_0074:
            if ((classFiled.Default_value > null) == null)
            {
                goto Label_00DB;
            }
            if (((classFiled.Default_value as string) > null) == null)
            {
                goto Label_00B8;
            }
            builder.Append(" default '" + classFiled.Default_value + "'");
            goto Label_00DA;
            Label_00B8 :;
            Label_00D3 :
            builder.Append((" default " + classFiled.Default_value) ?? "");
            Label_00DA :;
            Label_00DB :
            str = builder.ToString();
Label_00E4:
            return(str);
        }
        /// <summary>
        /// 添加到集合中
        /// </summary>
        /// <param name="list"></param>
        /// <param name="propertyInfo"></param>
        /// <param name="obj"></param>
        public static void AddToList(List <ClassFiledInfo> list, PropertyInfo propertyInfo, object obj = null)
        {
            ClassFiledInfo info;

            if (list == null)
            {
                list = new List <ClassFiledInfo>();
            }

            if ((propertyInfo.GetCustomAttribute <IgnoreColumnAttribute>() == null))
            {
                info = new ClassFiledInfo(propertyInfo, null)
                {
                    CustomAttribute = propertyInfo.GetCustomAttribute <TargetColumnAttribute>()
                };
                if (!list.Contains(info))
                {
                    list.Add(info);
                }
            }
        }
Exemplo n.º 3
0
        public static void AddToList(List <ClassFiledInfo> list, PropertyInfo propertyInfo, object obj = null)
        {
            IgnoreColumnAttribute attribute;
            ClassFiledInfo        info;

            if (((list == null) ? 1 : (propertyInfo == null)) == null)
            {
            }

            if ((propertyInfo.GetCustomAttribute <IgnoreColumnAttribute>() == null))
            {
                info = new ClassFiledInfo(propertyInfo, null);
                info.CustomAttribute = propertyInfo.GetCustomAttribute <TargetColumnAttribute>();
                if (!list.Contains(info))
                {
                    list.Add(info);
                }
            }

            info = null;


            return;
        }