Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/ClientConfigAdapter.cs @ 3011

Last change on this file since 3011 was 3011, checked in by kgrading, 14 years ago

changed the complete DAL to LINQ 2 SQL (with the exception of the job streaming), did a lot of refactoring, Introduced DTOs (that are named DTOs for better understanding), added the spring.NET Interceptor, reintroduced transactions and cleaned up the whole JobResult thing and updated a part of the config merger (#830)

File size: 1.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.DataAccess.ADOHelper;
6using HeuristicLab.Hive.Contracts.BusinessObjects;
7using HeuristicLab.Hive.Server.DataAccess;
8using HeuristicLab.Hive.Server.ADODataAccess.TableAdapterWrapper;
9
10namespace 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}
Note: See TracBrowser for help on using the repository browser.