Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/TableAdapterWrapper/RequiredPluginsAdapterWrapper.cs @ 1580

Last change on this file since 1580 was 1580, checked in by svonolfe, 15 years ago

Added PluginInfoAdapter (#372)

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.Hive.Contracts.BusinessObjects;
8using System.Data.Common;
9
10namespace HeuristicLab.Hive.Server.ADODataAccess.TableAdapterWrapper {
11  class RequiredPluginsAdapterWrapper :
12  TableAdapterWrapperBase<dsHiveServerTableAdapters.RequiredPluginsTableAdapter,
13  ManyToManyRelation,
14  dsHiveServer.RequiredPluginsRow> {
15    public override dsHiveServer.RequiredPluginsRow
16     InsertNewRow(ManyToManyRelation relation) {
17      dsHiveServer.RequiredPluginsDataTable data =
18         new dsHiveServer.RequiredPluginsDataTable();
19
20      dsHiveServer.RequiredPluginsRow row =
21        data.NewRequiredPluginsRow();
22
23      row.JobId = relation.Id;
24      row.PluginId = relation.Id2;
25
26      data.AddRequiredPluginsRow(row);
27      TransactionalAdapter.Update(row);
28
29      return row;
30    }
31
32    public override void
33      UpdateRow(dsHiveServer.RequiredPluginsRow row) {
34      TransactionalAdapter.Update(row);
35    }
36
37    public override IEnumerable<dsHiveServer.RequiredPluginsRow>
38      FindById(Guid id) {
39      return TransactionalAdapter.GetDataById(id);
40    }
41
42    public override IEnumerable<dsHiveServer.RequiredPluginsRow>
43      FindAll() {
44      return TransactionalAdapter.GetData();
45    }
46
47    protected override void SetConnection(DbConnection connection) {
48      adapter.Connection = connection as SqlConnection;
49    }
50
51    protected override void SetTransaction(DbTransaction transaction) {
52      adapter.Transaction = transaction as SqlTransaction;
53    }
54  }
55}
Note: See TracBrowser for help on using the repository browser.