Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Security.ADODataAccess/3.2/TableAdapterWrapper/UserGroupAdapterWrapper.cs @ 1835

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

Implemented large parts of the security DAL (#597)

File size: 1.5 KB
RevLine 
[1656]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 UserGroupAdapterWrapper :
12   TableAdapterWrapperBase<
13       dsSecurityTableAdapters.UserGroupTableAdapter,
14       UserGroup,
15       dsSecurity.UserGroupRow> {
16    public override void UpdateRow(dsSecurity.UserGroupRow row) {
17      TransactionalAdapter.Update(row);
18    }
19
20    public override dsSecurity.UserGroupRow
21      InsertNewRow(UserGroup group) {
22      dsSecurity.UserGroupDataTable data =
23        new dsSecurity.UserGroupDataTable();
24
25      dsSecurity.UserGroupRow row = data.NewUserGroupRow();
26      row.PermissionOwnerId = group.Id;
27      data.AddUserGroupRow(row);
28
29      return row;
30    }
31
32    public override IEnumerable<dsSecurity.UserGroupRow>
33      FindById(Guid id) {
34      return TransactionalAdapter.GetDataById(id);
35    }
36
37    public override IEnumerable<dsSecurity.UserGroupRow>
38      FindAll() {
39      return TransactionalAdapter.GetData();
40    }
41
42    protected override void SetConnection(DbConnection connection) {
43      adapter.Connection = connection as SqlConnection;
44    }
45
46    protected override void SetTransaction(DbTransaction transaction) {
47      adapter.Transaction = transaction as SqlTransaction;
48    }
49  }
50}
Note: See TracBrowser for help on using the repository browser.