Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/TableAdapterWrapper/AssignedResourcesAdapterWrapper.cs @ 2099

Last change on this file since 2099 was 1947, checked in by svonolfe, 16 years ago

Added assigned resources to job adapter (#372)

File size: 1.6 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 AssignedResourcesAdapterWrapper :
12  TableAdapterWrapperBase<dsHiveServerTableAdapters.AssignedResourcesTableAdapter,
13  ManyToManyRelation,
14  dsHiveServer.AssignedResourcesRow> {
15    public override dsHiveServer.AssignedResourcesRow
16     InsertNewRow(ManyToManyRelation relation) {
17      dsHiveServer.AssignedResourcesDataTable data =
18         new dsHiveServer.AssignedResourcesDataTable();
19
20      dsHiveServer.AssignedResourcesRow row =
21        data.NewAssignedResourcesRow();
22
23      row.JobId = relation.Id;
24      row.ResourceId = relation.Id2;
25
26      data.AddAssignedResourcesRow(row);
27
28      return row;
29    }
30
31    public override void
32      UpdateRow(dsHiveServer.AssignedResourcesRow row) {
33      TransactionalAdapter.Update(row);
34    }
35
36    public override IEnumerable<dsHiveServer.AssignedResourcesRow>
37      FindById(Guid id) {
38      return TransactionalAdapter.GetDataByJobId(id);
39    }
40
41    public override IEnumerable<dsHiveServer.AssignedResourcesRow>
42      FindAll() {
43      return TransactionalAdapter.GetData();
44    }
45
46    protected override void SetConnection(DbConnection connection) {
47      adapter.Connection = connection as SqlConnection;
48    }
49
50    protected override void SetTransaction(DbTransaction transaction) {
51      adapter.Transaction = transaction as SqlTransaction;
52    }
53  }
54}
Note: See TracBrowser for help on using the repository browser.