Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/30/09 16:58:54 (15 years ago)
Author:
svonolfe
Message:

Fixed some bugs in the Security DAL (#597)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/ManyToManyRelationHelper.cs

    r1656 r1729  
    2323
    2424    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);
    2727    }
    2828
    2929    public void UpdateRelationships(Guid objectA,
    3030      IList<Guid> relationships,
    31       IList<object> additionalAttributes) {
     31      IList<object> additionalAttributes, int childIndex) {
    3232      //firstly check for created references
    3333      IList<Guid> existing =
    34         this.GetRelationships(objectA);
     34        this.GetRelationships(objectA, childIndex);
    3535
    3636      foreach (Guid relationship in relationships) {
     
    6363      foreach (Guid relationship in deleted) {
    6464        RowT toDelete =
    65           FindRow(objectA, relationship);
     65          FindRow(objectA, relationship, childIndex);
    6666        if (toDelete != null) {
    6767          toDelete.Delete();
     
    7171    }
    7272
    73     public IList<Guid> GetRelationships(Guid objectA) {
     73    public IList<Guid> GetRelationships(Guid objectA, int childIndex) {
    7474      IList<Guid> result =
    7575        new List<Guid>();
     
    7979
    8080      foreach(RowT row in rows) {
    81         result.Add((Guid)row[1]);
     81        result.Add((Guid)row[childIndex]);
    8282      }
    8383
     
    8585    }
    8686
    87     private RowT FindRow(Guid objectA, Guid objectB) {
     87    private RowT FindRow(Guid objectA, Guid objectB, int childIndex) {
    8888      IEnumerable<RowT> rows =
    8989       tableAdapterWrapper.FindById(objectA);
     
    9292
    9393      foreach (RowT row in rows) {
    94         if (row[1].Equals(objectB)) {
     94        if (row[childIndex].Equals(objectB)) {
    9595          found = row;
    9696          break;
Note: See TracChangeset for help on using the changeset viewer.