Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
Esempio n. 1
0
        public List<MappingTool.Metadata> GetItems(SqlConnection connection, SqlTransaction transaction)
        {
            var output = new List<MappingTool.Metadata>();
            var command = connection.CreateCommand();
            command.Transaction = transaction;
            command.CommandText = Sql;
            command.Parameters.Add(new SqlParameter("@MetadataName", _metadataName));
            using (var dr = command.ExecuteReader())
            {
                while (dr.Read())
                {
                    var item = new MappingTool.Metadata();
                    item.MetadataId = new Guid(dr["MetadataId"].ToString());
                    item.MetadataTypeUid = new Guid(dr["MetadataTypeUid"].ToString());
                    if (dr["NodeUid"] != DBNull.Value)
                    {
                        item.NodeUid = new Guid(dr["NodeUid"].ToString());
                    }
                    
                    item.MetadataName = dr["MetadataName"].ToString();
                    item.MetadataValue = dr["MetadataValue"].ToString();

                    if (dr["RootMapUid"] != DBNull.Value)
                    {
                        item.RootMapUid = new Guid(dr["RootMapUid"].ToString());
                    }
                    if (dr["DomainUid"] != DBNull.Value)
                    {
                        item.DomainUid = new Guid(dr["DomainUid"].ToString());
                    }

                    item.Modified = dr["Modified"] == DBNull.Value ? null : (DateTime?)dr["Modified"];
                    item.ModifiedBy = dr["ModifiedBy"] == DBNull.Value? null : dr["ModifiedBy"].ToString();
                    item.Created = dr["Created"] == DBNull.Value ? null : (DateTime?)dr["Created"];
                    item.CreatedBy = dr["CreatedBy"] == DBNull.Value? item.ModifiedBy: dr["CreatedBy"].ToString();
                    output.Add(item);
                }
            }
            return output;
        }
		private void detach_Metadatas(Metadata entity)
		{
			this.SendPropertyChanging();
			entity.DescriptorType = null;
		}
 partial void DeleteMetadata(Metadata instance);
 partial void UpdateMetadata(Metadata instance);
 partial void InsertMetadata(Metadata instance);
		private void detach_Metadatas(Metadata entity)
		{
			this.SendPropertyChanging();
			entity.Relationship = null;
		}
		private void detach_Metadatas1(Metadata entity)
		{
			this.SendPropertyChanging();
			entity.Node1 = null;
		}
		private void attach_Metadatas(Metadata entity)
		{
			this.SendPropertyChanging();
			entity.Node = this;
		}
		private void detach_Metadatas(Metadata entity)
		{
			this.SendPropertyChanging();
			entity.Domain = null;
		}