コード例 #1
0
ファイル: PartitionFunction.cs プロジェクト: sbane/SQLoogle
 public static Boolean Compare(PartitionFunction origen, PartitionFunction destino)
 {
     if (destino == null)
     {
         throw new ArgumentNullException("destino");
     }
     if (origen == null)
     {
         throw new ArgumentNullException("origen");
     }
     if (!origen.Type.Equals(destino.Type))
     {
         return(false);
     }
     if (origen.Size != destino.Size)
     {
         return(false);
     }
     if (origen.Precision != destino.Precision)
     {
         return(false);
     }
     if (origen.Scale != destino.Scale)
     {
         return(false);
     }
     if (origen.IsBoundaryRight != destino.IsBoundaryRight)
     {
         return(false);
     }
     return(true);
 }
コード例 #2
0
 public new PartitionFunction Clone(ISchemaBase parent)
 {
     PartitionFunction item = new PartitionFunction(parent);
     item.Id = this.Id;
     item.IsBoundaryRight = this.IsBoundaryRight;
     item.Name = this.Name;
     item.Precision = this.Precision;
     item.Scale = this.Scale;
     item.Size = this.Size;
     item.Type = this.Type;
     this.Values.ForEach(value => { item.Values.Add(value); });
     return item;
 }
コード例 #3
0
ファイル: PartitionFunction.cs プロジェクト: sbane/SQLoogle
        public new PartitionFunction Clone(ISchemaBase parent)
        {
            PartitionFunction item = new PartitionFunction(parent);

            item.Id = this.Id;
            item.IsBoundaryRight = this.IsBoundaryRight;
            item.Name            = this.Name;
            item.Precision       = this.Precision;
            item.Scale           = this.Scale;
            item.Size            = this.Size;
            item.Type            = this.Type;
            this.Values.ForEach(value => { item.Values.Add(value); });
            return(item);
        }
コード例 #4
0
ファイル: PartitionFunction.cs プロジェクト: sbane/SQLoogle
 public static Boolean CompareValues(PartitionFunction origen, PartitionFunction destino)
 {
     if (destino == null)
     {
         throw new ArgumentNullException("destino");
     }
     if (origen == null)
     {
         throw new ArgumentNullException("origen");
     }
     if (origen.Values.Count != destino.Values.Count)
     {
         return(false);
     }
     if (origen.Values.Except(destino.values).ToList().Count != 0)
     {
         return(false);
     }
     return(true);
 }
コード例 #5
0
 public void Fill(Database database, string connectioString)
 {
     int lastObjectId = 0;
     PartitionFunction item = null;
     if (database.Options.Ignore.FilterPartitionFunction)
     {
         using (SqlConnection conn = new SqlConnection(connectioString))
         {
             using (SqlCommand command = new SqlCommand(GetSQL(), conn))
             {
                 conn.Open();
                 command.CommandTimeout = 0;
                 using (SqlDataReader reader = command.ExecuteReader())
                 {
                     while (reader.Read())
                     {
                         if (lastObjectId != (int)reader["function_id"])
                         {
                             lastObjectId = (int)reader["function_id"];
                             item = new PartitionFunction(database);
                             item.Id = (int)reader["function_id"];
                             item.Name = reader["name"].ToString();
                             item.IsBoundaryRight = (bool)reader["IsRight"];
                             item.Precision = (byte)reader["precision"];
                             item.Scale = (byte)reader["scale"];
                             item.Size = (short)reader["max_length"];
                             item.Type = reader["TypeName"].ToString();
                             database.PartitionFunctions.Add(item);
                         }
                         if (item.Type.Equals("binary") || item.Type.Equals("varbinary"))
                             item.Values.Add(ToHex((byte[])reader["value"]));
                         else
                             item.Values.Add(reader["value"].ToString());
                     }
                 }
             }
         }
     }
 }
コード例 #6
0
 public static Boolean CompareValues(PartitionFunction origen, PartitionFunction destino)
 {
     if (destino == null) throw new ArgumentNullException("destino");
     if (origen == null) throw new ArgumentNullException("origen");
     if (origen.Values.Count != destino.Values.Count) return false;
     if (origen.Values.Except(destino.values).ToList().Count != 0) return false;
     return true;
 }
コード例 #7
0
 public static Boolean Compare(PartitionFunction origen, PartitionFunction destino)
 {
     if (destino == null) throw new ArgumentNullException("destino");
     if (origen == null) throw new ArgumentNullException("origen");
     if (!origen.Type.Equals(destino.Type)) return false;
     if (origen.Size != destino.Size) return false;
     if (origen.Precision != destino.Precision) return false;
     if (origen.Scale != destino.Scale) return false;
     if (origen.IsBoundaryRight != destino.IsBoundaryRight) return false;
     return true;
 }