Esempio n. 1
0
        /// <summary>
        /// Quietly removes an address from the collection that matches the existing address type
        /// </summary>
        /// <param name="address"></param>
        private void RemoveExistingAddress(EntityAddress address)
        {
            EntityAddress existingAddress = GetAddressByType(address.Type.Guid);

            if (existingAddress != null)
                RemoveAddress(existingAddress);
        }
Esempio n. 2
0
 /// <summary>
 /// Removes an EntityAddress from this entity
 /// </summary>
 /// <param name="address">EntityAddress to remove</param>
 /// <remarks>This method wraps <see cref="List&lt;T&gt;.Remove"/>.</remarks>
 public void RemoveAddress(EntityAddress address)
 {
     Addresses.Remove(address);
 }
Esempio n. 3
0
        /// <summary>
        /// Inserts an EntityAddress into the EntityAddress collection.
        /// </summary>
        /// <param name="index">The index to insert the <paramref name="address"/> into.</param>
        /// <param name="address">The EntityAddress to insert into the collection.</param>
        /// <remarks>This method wraps <see cref="List&lt;T&gt;.Insert"/>.</remarks>
        public void InsertAddress(int index, EntityAddress address)
        {
            // IMPORTANT!!! MAKE SURE that you put any logic that you place into this method
            // into the AddAddress method as well!!!!
            RemoveExistingAddress(address);

            Addresses.Insert(index, address);
        }
Esempio n. 4
0
 /// <summary>
 /// Gets the index of a particular EntityAddress
 /// </summary>
 /// <param name="address">EntityAddress to get the index of</param>
 /// <returns>The index of the specified EntityAddress</returns>
 public int GetIndexOfAddress(EntityAddress address)
 {
     return Addresses.IndexOf(address);
 }
Esempio n. 5
0
 /// <summary>
 /// Checks to see whether an EntityAddress exists in the
 /// EntityAddress collection
 /// </summary>
 /// <param name="address">EntityAddress to check</param>
 /// <returns>True if the EntityAddress exists, false if not</returns>
 /// <remarks>This method wraps <see cref="List&lt;T&gt;.Contains"/>.</remarks>
 public bool ContainsAddress(EntityAddress address)
 {
     return Addresses.Contains(address);
 }
        /// <summary>
        /// Nulls the safe get.
        /// </summary>
        /// <param name="rs">The rs.</param>
        /// <param name="names">The names.</param>
        /// <param name="session">The session.</param>
        /// <param name="owner">The owner.</param>
        /// <returns></returns>
        public Object NullSafeGet(IDataReader rs, string[] names, ISessionImplementor session, Object owner)
        {
            EntityAddress result = new EntityAddress();
            result.Name = NHibernateUtil.String.NullSafeGet(rs, names[0], session, owner) as string;
            result.Line1 = NHibernateUtil.String.NullSafeGet(rs, names[1], session, owner) as string;
            result.Line2 = NHibernateUtil.String.NullSafeGet(rs, names[2], session, owner) as string;
            result.Line3 = NHibernateUtil.String.NullSafeGet(rs, names[3], session, owner) as string;
            result.City = NHibernateUtil.String.NullSafeGet(rs, names[4], session, owner) as string;
            result.State = NHibernateUtil.String.NullSafeGet(rs, names[5], session, owner) as string;
            result.PostalCode = NHibernateUtil.String.NullSafeGet(rs, names[6], session, owner) as string;
            result.Country = NHibernateUtil.String.NullSafeGet(rs, names[7], session, owner) as string;

            return result;
        }