Commit dc1cfa0407039e7b45193b95a889aae71a57e8b4
1 parent
76ddcac9
pixcelLocation Merged code
Showing
1 changed file
with
16 additions
and
11 deletions
400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs
... | ... | @@ -12,13 +12,14 @@ namespace AIAHTML5.API.Models |
12 | 12 | |
13 | 13 | internal static dynamic GetBodyRegionsPixelData(string layerNumber, string bodyViewIndex, string systemNumber, string zoom) |
14 | 14 | { |
15 | - var client = new MongoClient(); | |
16 | - var db = client.GetDatabase("aia"); | |
17 | - var client = new MongoClient(); | |
15 | + try | |
16 | + { | |
17 | + var client = new MongoClient(); | |
18 | + var db = client.GetDatabase("AIAHTML5"); | |
18 | 19 | |
19 | - var col = db.GetCollection<BsonDocument>("DAImages"); | |
20 | + var col = db.GetCollection<BsonDocument>("DAImages"); | |
20 | 21 | |
21 | - var pipeline = new BsonDocument[] | |
22 | + var pipeline = new BsonDocument[] | |
22 | 23 | { |
23 | 24 | new BsonDocument{{"$unwind", "$terms"}}, |
24 | 25 | 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 |
30 | 31 | }; |
31 | 32 | |
32 | 33 | |
33 | - var pixelData = col.Aggregate<BsonDocument>(pipeline).ToList(); | |
34 | + var pixelData = col.Aggregate<BsonDocument>(pipeline).ToList(); | |
34 | 35 | |
35 | - return pixelData.ToJson(); | |
36 | + return pixelData.ToJson(); | |
37 | + } | |
38 | + catch (Exception e) | |
39 | + { | |
40 | + string error = e.Message + "..STACKTRACE: " + e.StackTrace; | |
41 | + return error; | |
42 | + } | |
36 | 43 | } |
37 | - string error = e.Message+"..STACKTRACE: "+e.StackTrace; | |
38 | - return error; | |
39 | -} | |
40 | -} | |
44 | + } | |
45 | +} | |
41 | 46 | \ No newline at end of file | ... | ... |