Migrate from Filesystem to Base
This commit is contained in:
@@ -19,30 +19,20 @@ namespace ZUGFeRDRESTService
|
||||
private Dictionary<string, XmlItemProperty> _propertyMap = null;
|
||||
|
||||
private const string QUERY_GET_GDPICTURE_KEY = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'";
|
||||
private const string QUERY_GET_PROPERTY_MAP = "SELECT * FROM TBEDM_XML_ITEMS WHERE ACTIVE = True ORDER BY XML_PATH";
|
||||
private const string QUERY_GET_PROPERTY_MAP = "SELECT * FROM TBDD_ZUGFERD_XML_ITEMS WHERE ACTIVE = 1 ORDER BY XML_PATH";
|
||||
|
||||
public MSSQLServer MSSQL { get; set; }
|
||||
public Firebird Firebird { get; set; }
|
||||
|
||||
public Database(ILogging Logging, IConfiguration Config)
|
||||
{
|
||||
var oLogConfig = Logging.LogConfig;
|
||||
var oLogger = Logging.LogConfig.GetLogger();
|
||||
var oAppConfig = Config.GetSection("Config");
|
||||
var oFirebirdConfig = oAppConfig.GetSection("Firebird");
|
||||
|
||||
oLogger.Debug("Establishing MSSQL Database connection..");
|
||||
MSSQL = new MSSQLServer(oLogConfig, oAppConfig["MSSQLConnectionString"]);
|
||||
|
||||
oLogger.Debug("Establishing Firebird Database connection..");
|
||||
Firebird = new Firebird(oLogConfig,
|
||||
oFirebirdConfig["Datasource"],
|
||||
oFirebirdConfig["Database"],
|
||||
oFirebirdConfig["Username"],
|
||||
oFirebirdConfig["Password"]);
|
||||
|
||||
oLogger.Debug("MSSQL Connection: [{0}]", MSSQL.CurrentConnectionString);
|
||||
oLogger.Debug("Firebird Connection: [{0}]", Firebird.ConnectionString);
|
||||
|
||||
_Logger = oLogger;
|
||||
}
|
||||
@@ -62,7 +52,7 @@ namespace ZUGFeRDRESTService
|
||||
_Logger.Debug("Property map does not exist, creating.");
|
||||
|
||||
_propertyMap = new Dictionary<string, XmlItemProperty>();
|
||||
var oDatatable = Firebird.GetDatatable(QUERY_GET_PROPERTY_MAP);
|
||||
var oDatatable = MSSQL.GetDatatable(QUERY_GET_PROPERTY_MAP);
|
||||
|
||||
_Logger.Debug("Datatable Rows: [{0}]", oDatatable.Rows);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user