Changeset 1729 for trunk/sources/HeuristicLab.DataAccess.ADOHelper
- Timestamp:
- 04/30/09 16:58:54 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/ManyToManyRelationHelper.cs
r1656 r1729 23 23 24 24 public void UpdateRelationships(Guid objectA, 25 IList<Guid> relationships ) {26 UpdateRelationships(objectA, relationships, null );25 IList<Guid> relationships, int childIndex) { 26 UpdateRelationships(objectA, relationships, null, childIndex); 27 27 } 28 28 29 29 public void UpdateRelationships(Guid objectA, 30 30 IList<Guid> relationships, 31 IList<object> additionalAttributes ) {31 IList<object> additionalAttributes, int childIndex) { 32 32 //firstly check for created references 33 33 IList<Guid> existing = 34 this.GetRelationships(objectA );34 this.GetRelationships(objectA, childIndex); 35 35 36 36 foreach (Guid relationship in relationships) { … … 63 63 foreach (Guid relationship in deleted) { 64 64 RowT toDelete = 65 FindRow(objectA, relationship );65 FindRow(objectA, relationship, childIndex); 66 66 if (toDelete != null) { 67 67 toDelete.Delete(); … … 71 71 } 72 72 73 public IList<Guid> GetRelationships(Guid objectA ) {73 public IList<Guid> GetRelationships(Guid objectA, int childIndex) { 74 74 IList<Guid> result = 75 75 new List<Guid>(); … … 79 79 80 80 foreach(RowT row in rows) { 81 result.Add((Guid)row[ 1]);81 result.Add((Guid)row[childIndex]); 82 82 } 83 83 … … 85 85 } 86 86 87 private RowT FindRow(Guid objectA, Guid objectB ) {87 private RowT FindRow(Guid objectA, Guid objectB, int childIndex) { 88 88 IEnumerable<RowT> rows = 89 89 tableAdapterWrapper.FindById(objectA); … … 92 92 93 93 foreach (RowT row in rows) { 94 if (row[ 1].Equals(objectB)) {94 if (row[childIndex].Equals(objectB)) { 95 95 found = row; 96 96 break;
Note: See TracChangeset
for help on using the changeset viewer.