Ejemplo n.º 1
0
        /// <summary>
        /// Removes the specified item from the collection of business objects.
        /// </summary>
        /// <param name="member">The relationship member.</param>
        /// <param name="links">A collection of business objects.</param>
        /// <param name="link">The item to remove.</param>
        private void Remove(EntityRelationshipMember member, IList links, Object link)
        {
            EntityUtil.Remove(links, link);

            if (member != null && member.HasDataSource)
            {
                member.GetLinkedDataSource().Delete(link);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Updates the specified business object with the specified name/value pairs.
 /// </summary>
 /// <param name="member">The relationship member.</param>
 /// <param name="link">The business object to update.</param>
 /// <param name="values">A collection of name/value pairs to insert.</param>
 private void Update(EntityRelationshipMember member, Object link, IDictionary values)
 {
     if (member != null && member.HasDataSource)
     {
         member.GetLinkedDataSource().Update(link, values);
     }
     else
     {
         EntityUtil.SetEntityValues(link, values);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Inserts any previously cached business object references.
        /// </summary>
        /// <param name="member">The relationship member.</param>
        private void Insert(EntityRelationshipMember member)
        {
            if (member != null && member.HasDataSource)
            {
                Object entityKeyValue = PrimaryMember.GetEntityId();

                foreach (IDictionary values in member.Inserts)
                {
                    values[member.EntityKeyName] = entityKeyValue;
                    member.GetLinkedDataSource().Insert(values);
                }

                member.Inserts.Clear();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets the collection of business objects from the specified relationship member.
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="member">The relationship member.</param>
        /// <param name="listPropertyName">The property name.</param>
        /// <returns>A collection of business objects which represent the
        /// relationship defined by the specified relationship member.</returns>
        protected IList GetList(Object entity, EntityRelationshipMember member, String listPropertyName)
        {
            IList list;

            if (member != null && member.HasDataSource)
            {
                // get list from data source
                list = member.GetEntityList();
            }
            else
            {
                // get list from DeepLoaded entity
                list = EntityUtil.GetEntityList(entity, listPropertyName);
            }

            return(list);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Inserts the specified name/value pairs into the
        /// relationship defined by the specified member.
        /// </summary>
        /// <param name="member">The relationship member.</param>
        /// <param name="links">A collection of business objects.</param>
        /// <param name="values">A collection of name/value pairs to insert.</param>
        /// <param name="initEntityKey">A value indicating whether or not to initialize the
        /// business object's unique identifier property before executing the insert operation.</param>
        private void Insert(EntityRelationshipMember member, IList links, IDictionary values, bool initEntityKey)
        {
            if (member != null && member.HasDataSource)
            {
                member.GetLinkedDataSource().Insert(values);
            }
            else
            {
                Object link = EntityUtil.GetNewEntity(member.EntityType);
                EntityUtil.SetEntityValues(link, values);

                if (initEntityKey)
                {
                    EntityUtil.SetEntityKeyValue(link, member.EntityKeyName);
                }

                EntityUtil.Add(links, link);
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Inserts the specified name/value pairs into the
 /// relationship defined by the specified member.
 /// </summary>
 /// <param name="member">The relationship member.</param>
 /// <param name="links">A collection of business objects.</param>
 /// <param name="values">A collection of name/value pairs to insert.</param>
 private void Insert(EntityRelationshipMember member, IList links, IDictionary values)
 {
     Insert(member, links, values, false);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Gets the collection of business objects from the specified relationship member.
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="member">The relationship member.</param>
        /// <param name="listPropertyName">The property name.</param>
        /// <returns>A collection of business objects which represent the
        /// relationship defined by the specified relationship member.</returns>
        protected IList GetList(Object entity, EntityRelationshipMember member, String listPropertyName)
        {
            IList list;

            if ( member != null && member.HasDataSource )
            {
                // get list from data source
                list = member.GetEntityList();
            }
            else
            {
                // get list from DeepLoaded entity
                list = EntityUtil.GetEntityList(entity, listPropertyName);
            }

            return list;
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Updates the specified business object with the specified name/value pairs.
 /// </summary>
 /// <param name="member">The relationship member.</param>
 /// <param name="link">The business object to update.</param>
 /// <param name="values">A collection of name/value pairs to insert.</param>
 private void Update(EntityRelationshipMember member, Object link, IDictionary values)
 {
     if ( member != null && member.HasDataSource )
     {
         member.GetLinkedDataSource().Update(link, values);
     }
     else
     {
         EntityUtil.SetEntityValues(link, values);
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Removes the specified item from the collection of business objects.
        /// </summary>
        /// <param name="member">The relationship member.</param>
        /// <param name="links">A collection of business objects.</param>
        /// <param name="link">The item to remove.</param>
        private void Remove(EntityRelationshipMember member, IList links, Object link)
        {
            EntityUtil.Remove(links, link);

            if ( member != null && member.HasDataSource )
            {
                member.GetLinkedDataSource().Delete(link);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Inserts the specified name/value pairs into the
        /// relationship defined by the specified member.
        /// </summary>
        /// <param name="member">The relationship member.</param>
        /// <param name="links">A collection of business objects.</param>
        /// <param name="values">A collection of name/value pairs to insert.</param>
        /// <param name="initEntityKey">A value indicating whether or not to initialize the
        /// business object's unique identifier property before executing the insert operation.</param>
        private void Insert(EntityRelationshipMember member, IList links, IDictionary values, bool initEntityKey)
        {
            if ( member != null && member.HasDataSource )
            {
                member.GetLinkedDataSource().Insert(values);
            }
            else
            {
                Object link = EntityUtil.GetNewEntity(member.EntityType);
                EntityUtil.SetEntityValues(link, values);

                if ( initEntityKey )
                {
                    EntityUtil.SetEntityKeyValue(link, member.EntityKeyName);
                }

                EntityUtil.Add(links, link);
            }
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Inserts the specified name/value pairs into the
 /// relationship defined by the specified member.
 /// </summary>
 /// <param name="member">The relationship member.</param>
 /// <param name="links">A collection of business objects.</param>
 /// <param name="values">A collection of name/value pairs to insert.</param>
 private void Insert(EntityRelationshipMember member, IList links, IDictionary values)
 {
     Insert(member, links, values, false);
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Inserts any previously cached business object references.
        /// </summary>
        /// <param name="member">The relationship member.</param>
        private void Insert(EntityRelationshipMember member)
        {
            if ( member != null && member.HasDataSource )
            {
                Object entityKeyValue = PrimaryMember.GetEntityId();

                foreach ( IDictionary values in member.Inserts )
                {
                    values[member.EntityKeyName] = entityKeyValue;
                    member.GetLinkedDataSource().Insert(values);
                }

                member.Inserts.Clear();
            }
        }