Files
jdescopingtool/OLD/DataModel/Process/CMS.cs
T
Joseph Doherty 26ff8d9b4f 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.
2026-01-02 07:43:29 -05:00

52 lines
1.5 KiB
C#
Executable File

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;
}
}
}