diff --git a/WEBSERVICES/ZUGFeRDRESTService/Database.cs b/WEBSERVICES/ZUGFeRDRESTService/Database.cs index da034d25..ac19132a 100644 --- a/WEBSERVICES/ZUGFeRDRESTService/Database.cs +++ b/WEBSERVICES/ZUGFeRDRESTService/Database.cs @@ -14,6 +14,7 @@ namespace ZUGFeRDRESTService { public class Database: IDatabase { + private DigitalData.Modules.Logging.Logger _Logger = null; private string _gdPictureKey = null; private Dictionary _propertyMap = null; @@ -42,6 +43,8 @@ namespace ZUGFeRDRESTService oLogger.Debug("MSSQL Connection: [{0}]", MSSQL.CurrentConnectionString); oLogger.Debug("Firebird Connection: [{0}]", Firebird.ConnectionString); + + _Logger = oLogger; } public string GetGDPictureKey() @@ -52,12 +55,16 @@ namespace ZUGFeRDRESTService return _gdPictureKey; } - public Dictionary GetPropertyMap() + public Dictionary GetPropertyMap() { if (_propertyMap == null) { + _Logger.Debug("Property map does not exist, creating."); + _propertyMap = new Dictionary(); - var oDatatable = Firebird.GetDatatable(string.Format(QUERY_GET_PROPERTY_MAP, "DEFAULT")); + var oDatatable = Firebird.GetDatatable(QUERY_GET_PROPERTY_MAP); + + _Logger.Debug("Datatable Rows: [{0}]", oDatatable.Rows); foreach (DataRow oRow in oDatatable.Rows) { @@ -68,10 +75,16 @@ namespace ZUGFeRDRESTService TableColumn = oRow["TABLE_COLUMN"].ToString(), GroupScope = oRow["GROUP_SCOPE"].ToString(), IsRequired = (bool)oRow["IS_REQUIRED"], - IsGrouped = (bool)oRow["IS_GROUPED"] + IsGrouped = (bool)oRow["IS_GROUPED"], + Specification = oRow["SPECIFICATION"].ToString() }); } - } + } else + { + _Logger.Debug("Property map already exists, returning."); + } + + _Logger.Debug("Returning Property Map with [{0}] entries.", _propertyMap.Count); return _propertyMap; }