/// <summary> /// Compara dos triggers y devuelve true si son iguales, caso contrario, devuelve false. /// </summary> public static Boolean Compare(FileGroupFile origen, FileGroupFile destino) { if (destino == null) { throw new ArgumentNullException("destino"); } if (origen == null) { throw new ArgumentNullException("origen"); } if (origen.Growth != destino.Growth) { return(false); } if (origen.IsPercentGrowth != destino.IsPercentGrowth) { return(false); } if (origen.IsSparse != destino.IsSparse) { return(false); } if (origen.MaxSize != destino.MaxSize) { return(false); } if (!origen.PhysicalName.Equals(destino.PhysicalName)) { return(false); } return(true); }
private static void FillFiles(FileGroup filegroup, string connectionString) { using (SqlConnection conn = new SqlConnection(connectionString)) { using (SqlCommand command = new SqlCommand(GetSQLFile(filegroup), conn)) { conn.Open(); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { FileGroupFile item = new FileGroupFile(filegroup); item.Id = (int)reader["file_id"]; item.Name = reader["name"].ToString(); item.Owner = ""; item.Growth = (int)reader["growth"]; item.IsPercentGrowth = (bool)reader["is_percent_growth"]; item.IsSparse = (bool)reader["is_sparse"]; item.MaxSize = (int)reader["max_size"]; item.PhysicalName = reader["physical_name"].ToString(); item.Size = (int)reader["size"]; item.Type = (byte)reader["type"]; filegroup.Files.Add(item); } } } } }
/// <summary> /// Compara dos triggers y devuelve true si son iguales, caso contrario, devuelve false. /// </summary> public static Boolean Compare(FileGroupFile origen, FileGroupFile destino) { if (destino == null) throw new ArgumentNullException("destino"); if (origen == null) throw new ArgumentNullException("origen"); if (origen.Growth != destino.Growth) return false; if (origen.IsPercentGrowth != destino.IsPercentGrowth) return false; if (origen.IsSparse != destino.IsSparse) return false; if (origen.MaxSize != destino.MaxSize) return false; if (!origen.PhysicalName.Equals(destino.PhysicalName)) return false; return true; }
public override ISchemaBase Clone(ISchemaBase parent) { FileGroupFile file = new FileGroupFile(parent); file.Growth = this.Growth; file.Id = this.Id; file.IsPercentGrowth = this.IsPercentGrowth; file.IsSparse = this.IsSparse; file.MaxSize = this.MaxSize; file.Name = this.Name; file.PhysicalName = this.PhysicalName; file.Size = this.Size; file.Type = this.Type; return file; }
public override ISchemaBase Clone(ISchemaBase parent) { FileGroupFile file = new FileGroupFile(parent); file.Growth = this.Growth; file.Id = this.Id; file.IsPercentGrowth = this.IsPercentGrowth; file.IsSparse = this.IsSparse; file.MaxSize = this.MaxSize; file.Name = this.Name; file.PhysicalName = this.PhysicalName; file.Size = this.Size; file.Type = this.Type; return(file); }