Exemple #1
0
 public static Boolean CompareDefault(UserDataType origin, UserDataType destination)
 {
     if (destination == null)
     {
         throw new ArgumentNullException("destination");
     }
     if (origin == null)
     {
         throw new ArgumentNullException("origin");
     }
     if ((origin.Default.Name != null) && (destination.Default.Name == null))
     {
         return(false);
     }
     if ((origin.Default.Name == null) && (destination.Default.Name != null))
     {
         return(false);
     }
     if (origin.Default.Name != null)
     {
         if (!origin.Default.Name.Equals(destination.Default.Name))
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #2
0
        private string SQLDropOlder()
        {
            UserDataType other =
                ((Database)Parent).UserTypes.Find(
                    item =>
                    (item.Status == Enums.ObjectStatusType.DropStatus) &&
                    (item.AssemblyName + "." + item.AssemblyClass).Equals((AssemblyName + "." + AssemblyClass)));

            return(other.ToSqlDrop());
        }
Exemple #3
0
 public bool Compare(UserDataType obj)
 {
     if (obj == null)
     {
         throw new ArgumentNullException("obj");
     }
     if (Scale != obj.Scale)
     {
         return(false);
     }
     if (Precision != obj.Precision)
     {
         return(false);
     }
     if (AllowNull != obj.AllowNull)
     {
         return(false);
     }
     if (Size != obj.Size)
     {
         return(false);
     }
     if (!Type.Equals(obj.Type))
     {
         return(false);
     }
     if (IsAssembly != obj.IsAssembly)
     {
         return(false);
     }
     if (!AssemblyClass.Equals(obj.AssemblyClass))
     {
         return(false);
     }
     if (!AssemblyName.Equals(obj.AssemblyName))
     {
         return(false);
     }
     if (!CompareDefault(this, obj))
     {
         return(false);
     }
     if (!CompareRule(this, obj))
     {
         return(false);
     }
     return(true);
 }
Exemple #4
0
 private Boolean HasAnotherUDTClass()
 {
     if (IsAssembly)
     {
         /*If another UDT exists in the same assembly to bre created. It must be deleted BEFORE creating the new one.*/
         UserDataType other =
             ((Database)Parent).UserTypes.Find(
                 item =>
                 (item.Status == Enums.ObjectStatusType.DropStatus) &&
                 (item.AssemblyName + "." + item.AssemblyClass).Equals((AssemblyName + "." + AssemblyClass)));
         if (other != null)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #5
0
        /// <summary>
        /// Clona el objeto Column en una nueva instancia.
        /// </summary>
        public override ISchemaBase Clone(ISchemaBase parent)
        {
            var item = new UserDataType(parent)
            {
                Name          = Name,
                Id            = Id,
                Owner         = Owner,
                Guid          = Guid,
                AllowNull     = AllowNull,
                Precision     = Precision,
                Scale         = Scale,
                Size          = Size,
                Type          = Type,
                Default       = Default.Clone(this),
                Rule          = Rule.Clone(this),
                Dependencys   = Dependencys,
                IsAssembly    = IsAssembly,
                AssemblyClass = AssemblyClass,
                AssemblyId    = AssemblyId,
                AssemblyName  = AssemblyName
            };

            return(item);
        }