Initial commit: JDE Scoping Tool migration project
Set up repository with legacy .NET Framework 4.8 source (OLD/), new .NET 10 Blazor solution (NEW/), OpenSpec specifications, documentation, and project configuration.
This commit is contained in:
Executable
+51
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using DDTek.Oracle;
|
||||
using NLog;
|
||||
|
||||
namespace DataModel.Process
|
||||
{
|
||||
/// <summary>
|
||||
/// CMS interface
|
||||
/// </summary>
|
||||
public partial class CMS
|
||||
{
|
||||
/// <summary>
|
||||
/// Query repository name
|
||||
/// </summary>
|
||||
private const string RepositoryName = "CMS";
|
||||
|
||||
/// <summary>
|
||||
/// Query repository instance
|
||||
/// </summary>
|
||||
private static readonly QueryRepository queries = new QueryRepository(RepositoryName, Config.CMSQueryRepo);
|
||||
|
||||
/// <summary>
|
||||
/// Shared logger instance
|
||||
/// </summary>
|
||||
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Gets an open connection to the CMS DB
|
||||
/// </summary>
|
||||
/// <returns>Opened connection to the CMS DB</returns>
|
||||
private static OracleConnection GetConnection()
|
||||
{
|
||||
OracleConnection connection;
|
||||
|
||||
try
|
||||
{
|
||||
//Create the connection to the database and open it
|
||||
connection = new OracleConnection(Config.CMSCS);
|
||||
connection.Open();
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
//Log error and forward
|
||||
logger.Error("GetConnection: failed to open connection to CMS: {0}.", error.Message);
|
||||
throw new Exception("CMS: failed to open connection to CMS database.", error);
|
||||
}
|
||||
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user