Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Persistence Test/HeuristicLab.Security.ADODataAccess/3.2/TableAdapterWrapper/PermissionOwner_UserGroupAdapterWrapper.cs @ 4593

Last change on this file since 4593 was 1656, checked in by svonolfe, 16 years ago

Implemented large parts of the security DAL (#597)

File size: 1.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.DataAccess.ADOHelper;
6using System.Data.SqlClient;
7using HeuristicLab.Security.Contracts.BusinessObjects;
8using System.Data.Common;
9
10namespace HeuristicLab.Security.ADODataAccess.TableAdapterWrapper {
11  class PermissionOwner_UserGroupAdapterWrapper :
12   TableAdapterWrapperBase<
13       dsSecurityTableAdapters.PermissionOwner_UserGroupTableAdapter,
14       ManyToManyRelation,
15       dsSecurity.PermissionOwner_UserGroupRow> {
16    public override void UpdateRow(dsSecurity.PermissionOwner_UserGroupRow row) {
17      TransactionalAdapter.Update(row);
18    }
19
20    public override dsSecurity.PermissionOwner_UserGroupRow
21      InsertNewRow(ManyToManyRelation relation) {
22      dsSecurity.PermissionOwner_UserGroupDataTable data =
23        new dsSecurity.PermissionOwner_UserGroupDataTable();
24
25      dsSecurity.PermissionOwner_UserGroupRow row = data.NewPermissionOwner_UserGroupRow();
26      row.UserGroupId = relation.Id;
27      row.PermissionOwnerId = relation.Id2;
28
29      data.AddPermissionOwner_UserGroupRow(row);
30
31      return row;
32    }
33
34    public override IEnumerable<dsSecurity.PermissionOwner_UserGroupRow>
35      FindById(Guid id) {
36      return TransactionalAdapter.GetDataByUserGroupId(id);
37    }
38
39    public override IEnumerable<dsSecurity.PermissionOwner_UserGroupRow>
40      FindAll() {
41      return TransactionalAdapter.GetData();
42    }
43
44    protected override void SetConnection(DbConnection connection) {
45      adapter.Connection = connection as SqlConnection;
46    }
47
48    protected override void SetTransaction(DbTransaction transaction) {
49      adapter.Transaction = transaction as SqlTransaction;
50    }
51  }
52}
Note: See TracBrowser for help on using the repository browser.