Пример #1
0
 public Constraint(Table parent)
     : base("[", "]", StatusEnum.ObjectTypeEnum.Constraint)
 {
     this.Parent = parent;
     columns     = new ConstraintColumns(this);
     this.Status = StatusEnum.ObjectStatusType.OriginalStatus;
 }
Пример #2
0
        /// <summary>
        /// Clona el objeto ColumnConstraints en una nueva instancia.
        /// </summary>
        public ConstraintColumns Clone()
        {
            ConstraintColumns columns = new ConstraintColumns(parent);

            for (int index = 0; index < this.Count; index++)
            {
                columns.Add(this[index].Clone());
            }
            return(columns);
        }
Пример #3
0
 /// <summary>
 /// Compara dos campos y devuelve true si son iguales, caso contrario, devuelve false.
 /// </summary>
 public static Boolean Compare(Constraint origen, Constraint destino)
 {
     if (origen.NotForReplication != destino.NotForReplication)
     {
         return(false);
     }
     if (origen.Clustered != destino.Clustered)
     {
         return(false);
     }
     if ((origen.RelationalTable == null) && (destino.RelationalTable != null))
     {
         return(false);
     }
     if (origen.RelationalTable != null)
     {
         if (!origen.RelationalTable.Equals(destino.RelationalTable))
         {
             return(false);
         }
     }
     if (origen.WithNoCheck != destino.WithNoCheck)
     {
         return(false);
     }
     if (origen.OnUpdateCascade != destino.OnUpdateCascade)
     {
         return(false);
     }
     if (origen.OnDeleteCascade != destino.OnDeleteCascade)
     {
         return(false);
     }
     if (!ConstraintColumns.Compare(origen.Columns, destino.Columns))
     {
         return(false);
     }
     return(true);
 }
Пример #4
0
 /// <summary>
 /// Compara dos campos y devuelve true si son iguales, caso contrario, devuelve false.
 /// </summary>
 public static Boolean Compare(ConstraintColumns origen, ConstraintColumns destino)
 {
     if (origen.Count != destino.Count)
     {
         return(false);
     }
     for (int j = 0; j < origen.Count; j++)
     {
         if (!destino.Find(origen[j].Name))
         {
             return(false);
         }
     }
     for (int j = 0; j < destino.Count; j++)
     {
         if (!origen.Find(destino[j].Name))
         {
             return(false);
         }
     }
     return(true);
 }