Beispiel #1
0
 public UserDataType(ISchemaBase parent)
     : base(parent, Enums.ObjectType.UserDataType)
 {
     Default = new Default(this);
     Rule = new Rule(this);
     Dependencys = new List<ObjectDependency>();
 }
Beispiel #2
0
 public void Fill(Database database, string connectionString)
 {
     if (database.Options.Ignore.FilterRules)
     {
         using (SqlConnection conn = new SqlConnection(connectionString))
         {
             using (SqlCommand command = new SqlCommand(GetSQL(), conn))
             {
                 conn.Open();
                 using (SqlDataReader reader = command.ExecuteReader())
                 {
                     while (reader.Read())
                     {
                         Rule item = new Rule(database);
                         item.Id = (int)reader["object_id"];
                         item.Name = reader["Name"].ToString();
                         item.Owner = reader["Owner"].ToString();
                         item.Text = reader["Definition"].ToString();
                         database.Rules.Add(item);
                     }
                 }
             }
         }
     }
 }
Beispiel #3
0
 public new Rule Clone(ISchemaBase parent)
 {
     Rule item = new Rule(parent);
     item.Id = this.Id;
     item.Name = this.Name;
     item.Owner = this.Owner;
     item.Text = this.Text;
     item.Guid = this.Guid;
     return item;
 }
Beispiel #4
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);
        }