1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.DataAccess.ADOHelper;
|
---|
6 | using System.Data.SqlClient;
|
---|
7 | using HeuristicLab.Hive.Contracts.BusinessObjects;
|
---|
8 | using System.Data.Common;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Hive.Server.ADODataAccess.TableAdapterWrapper {
|
---|
11 | class ClientGroupAdapterWrapper :
|
---|
12 | TableAdapterWrapperBase<dsHiveServerTableAdapters.ClientGroupTableAdapter,
|
---|
13 | ClientGroupDto,
|
---|
14 | dsHiveServer.ClientGroupRow> {
|
---|
15 | public override dsHiveServer.ClientGroupRow
|
---|
16 | InsertNewRow(ClientGroupDto group) {
|
---|
17 | dsHiveServer.ClientGroupDataTable data =
|
---|
18 | new dsHiveServer.ClientGroupDataTable();
|
---|
19 |
|
---|
20 | dsHiveServer.ClientGroupRow row =
|
---|
21 | data.NewClientGroupRow();
|
---|
22 |
|
---|
23 | row.ResourceId = group.Id;
|
---|
24 |
|
---|
25 | data.AddClientGroupRow(row);
|
---|
26 |
|
---|
27 | return row;
|
---|
28 | }
|
---|
29 |
|
---|
30 | public override void
|
---|
31 | UpdateRow(dsHiveServer.ClientGroupRow row) {
|
---|
32 | TransactionalAdapter.Update(row);
|
---|
33 | }
|
---|
34 |
|
---|
35 | public override IEnumerable<dsHiveServer.ClientGroupRow>
|
---|
36 | FindById(Guid id) {
|
---|
37 | return TransactionalAdapter.GetDataById(id);
|
---|
38 | }
|
---|
39 |
|
---|
40 | public override IEnumerable<dsHiveServer.ClientGroupRow>
|
---|
41 | FindAll() {
|
---|
42 | return TransactionalAdapter.GetData();
|
---|
43 | }
|
---|
44 |
|
---|
45 | protected override void SetConnection(DbConnection connection) {
|
---|
46 | adapter.Connection = connection as SqlConnection;
|
---|
47 | }
|
---|
48 |
|
---|
49 | protected override void SetTransaction(DbTransaction transaction) {
|
---|
50 | adapter.Transaction = transaction as SqlTransaction;
|
---|
51 | }
|
---|
52 | }
|
---|
53 | }
|
---|