Exemplo n.º 1
0
 public Attribute(MetaObject owner, AttrNameType attrNameType)
 {
     this.id      = 0;
     this.name    = attrNameType.Name;
     this.type    = attrNameType.Type;
     this.value   = null;
     this.changed = false;
     this.owner   = owner;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Добавление нового атрибута в метабазу
        /// </summary>
        /// <param name="connection"></param>
        /// <param name="attr"></param>
        /// <param name="typeName"></param>
        protected void AddNewAttribute(SqlConnection connection, AttrNameType attr, string typeName)
        {
            SqlCommand   cmd       = new SqlCommand("AddNewAttr @attrName=@pattrName, @attrType=@pattrType, @typeName=@ptypeName", connection);
            SqlParameter pattrName = new SqlParameter("@pattrName", attr.Name);
            SqlParameter pattrType = new SqlParameter("@pattrType", attr.Type.ToString());
            SqlParameter ptypeName = new SqlParameter("@ptypeName", typeName);

            cmd.Parameters.Add(pattrName);
            cmd.Parameters.Add(pattrType);
            cmd.Parameters.Add(ptypeName);
            cmd.ExecuteNonQuery();
        }