Exemple #1
0
 /// <summary>
 /// Updates a ClubAddress in this club's collection.
 /// </summary>
 /// <param name="data">The address object to updated.</param>
 /// <returns>False by default, true if successful.</returns>
 public virtual bool UpdateAddress(ClubAddress data)
 {
     bool val = false;
     if (data != null && this.Contains(data))
     {
         int index = this.ClubAddresses.FindIndex(p => p.PrimaryKey == data.PrimaryKey);
         if (index < 0)
         {
             this.ClubAddresses.Add(data);
         }
         else
         {
             this.ClubAddresses[index] = data;
         }
         val = true;
     }
     return val;
 }
Exemple #2
0
 /// <summary>
 /// Does the list contain the ClubAddress object.
 /// </summary>
 /// <param name="data">The data object to check for.</param>
 public virtual bool Contains(ClubAddress data)
 {
     bool val = false;
     if (data != null)
     {
         int index = this.ClubAddresses.FindIndex(p => p.PrimaryKey == data.PrimaryKey);
         if (index > 0) val = true;
         else val = this.ClubAddresses.Contains(data);
     }
     return val;
 }