diff --git a/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs b/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs index 206c449..7c6fcf4 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs @@ -12,13 +12,14 @@ namespace AIAHTML5.API.Models internal static dynamic GetBodyRegionsPixelData(string layerNumber, string bodyViewIndex, string systemNumber, string zoom) { - var client = new MongoClient(); - var db = client.GetDatabase("aia"); - var client = new MongoClient(); + try + { + var client = new MongoClient(); + var db = client.GetDatabase("AIAHTML5"); - var col = db.GetCollection("DAImages"); + var col = db.GetCollection("DAImages"); - var pipeline = new BsonDocument[] + var pipeline = new BsonDocument[] { new BsonDocument{{"$unwind", "$terms"}}, new BsonDocument{ { "$match", new BsonDocument("terms.SystemNumbers", Convert.ToInt32(systemNumber)).Add("bodyViewIndex", Convert.ToInt32(bodyViewIndex)).Add("layerNumber", Convert.ToInt32(layerNumber)).Add("zoom", Convert.ToInt32(zoom)) }}, @@ -30,11 +31,15 @@ namespace AIAHTML5.API.Models }; - var pixelData = col.Aggregate(pipeline).ToList(); + var pixelData = col.Aggregate(pipeline).ToList(); - return pixelData.ToJson(); + return pixelData.ToJson(); + } + catch (Exception e) + { + string error = e.Message + "..STACKTRACE: " + e.StackTrace; + return error; + } } - string error = e.Message+"..STACKTRACE: "+e.StackTrace; - return error; -} -} + } +} \ No newline at end of file