Oracle database selection includes 'None', component Simulate mode not required anymore, ver. 2.12.497

This commit is contained in:
Milan Hanajik
2017-03-14 13:31:03 +01:00
parent c46dea3ae7
commit 94eb2909bc
3 changed files with 31 additions and 15 deletions
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -69,15 +69,29 @@ namespace TBF.BenchControl.DB.SensusOracle
public void Initialize()
{
connection = (DBCfg.DBUsed == DBUsed.Production)
? new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;")
: new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
switch (DBCfg.DBUsed)
{
case DBUsed.Production:
connection = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
break;
case DBUsed.Quality:
connection = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;"); /// TODO: Quality database specification
break;
case DBUsed.Test:
connection = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
break;
default:
connection = null;
break;
}
if (DBCfg.DebugLevel == DebugMode.Simulate) return;
///
/// Do something with the database to see if the connection works well
///
if (connection != null)
{
connection.Open();
string rslt = "none";
@@ -88,6 +102,7 @@ namespace TBF.BenchControl.DB.SensusOracle
connection.Close();
}
}
public void RunDeviceBefore() {}
public void RunDeviceAfter() {}
@@ -215,7 +230,7 @@ namespace TBF.BenchControl.DB.SensusOracle
bool anyError = false;
#if ORACLE_DB
if (DBCfg.DebugLevel != DebugMode.Simulate)
if (DBCfg.DebugLevel != DebugMode.Simulate && connection != null)
{
if (WriteResultsToDatabase(connection, batch, false) == Retv.Error) anyError = true;
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2016 Sensus Metering Systems
/// Copyright (c) 2015-2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,6 +11,7 @@ namespace TBF.BenchControl.DB.SensusOracle
{
public enum DBUsed
{
None,
Production,
Test,
Quality,
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.12.496.1")]
[assembly: AssemblyFileVersion("2.12.496.1")]
[assembly: AssemblyVersion("2.12.497.1")]
[assembly: AssemblyFileVersion("2.12.497.1")]