1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.DataAccess.ADOHelper;
|
---|
6 | using HeuristicLab.Hive.Contracts.BusinessObjects;
|
---|
7 | using HeuristicLab.Hive.Server.DataAccess;
|
---|
8 | using HeuristicLab.Hive.Server.ADODataAccess.TableAdapterWrapper;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Hive.Server.ADODataAccess {
|
---|
11 | class ClientConfigAdapter :
|
---|
12 | DataAdapterBase<
|
---|
13 | dsHiveServerTableAdapters.ClientConfigTableAdapter,
|
---|
14 | ClientConfigDto,
|
---|
15 | dsHiveServer.ClientConfigRow>,
|
---|
16 | IClientConfigAdapter {
|
---|
17 | public ClientConfigAdapter():
|
---|
18 | base(new ClientConfigAdapterWrapper()) {
|
---|
19 | }
|
---|
20 |
|
---|
21 | protected override dsHiveServer.ClientConfigRow
|
---|
22 | ConvertObj(ClientConfigDto config, dsHiveServer.ClientConfigRow row) {
|
---|
23 | if (row != null && config != null) {
|
---|
24 | row.ClientConfigId = config.Id;
|
---|
25 | //Todo: commOut
|
---|
26 | //row.HeartBeatIntervall = config.HeartBeatIntervall;
|
---|
27 | //row.UpDownTimeCalendar = config.UpDownTimeCalendar;
|
---|
28 |
|
---|
29 | return row;
|
---|
30 | } else
|
---|
31 | return null;
|
---|
32 | }
|
---|
33 |
|
---|
34 | protected override ClientConfigDto ConvertRow(dsHiveServer.ClientConfigRow row, ClientConfigDto config) {
|
---|
35 | if (config != null && row != null) {
|
---|
36 | config.Id = row.ClientConfigId;
|
---|
37 |
|
---|
38 | if (!row.IsHeartBeatIntervallNull())
|
---|
39 | config.HeartBeatIntervall = row.HeartBeatIntervall;
|
---|
40 | else
|
---|
41 | config.HeartBeatIntervall = 0;
|
---|
42 |
|
---|
43 | if (!row.IsUpDownTimeCalendarNull())
|
---|
44 | config.UpDownTimeCalendar = row.UpDownTimeCalendar;
|
---|
45 | else
|
---|
46 | config.UpDownTimeCalendar = null;
|
---|
47 |
|
---|
48 | return config;
|
---|
49 | } else
|
---|
50 | return null;
|
---|
51 | }
|
---|
52 | }
|
---|
53 | }
|
---|