From 36d77870427fd64a2e27dbbc16afc4dc251535d4 Mon Sep 17 00:00:00 2001 From: amrita.vishnoi Date: Mon, 14 Aug 2017 13:32:16 +0530 Subject: [PATCH] QA merge code --- 400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs.orig | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+), 0 deletions(-) create mode 100644 400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs.orig diff --git a/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs.orig b/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs.orig new file mode 100644 index 0000000..df055e2 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.API/Models/PixelLocator.cs.orig @@ -0,0 +1,55 @@ +using MongoDB.Bson; +using MongoDB.Driver; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace AIAHTML5.API.Models +{ + public class PixelLocator + { + + internal static dynamic GetBodyRegionsPixelData(string layerNumber, string bodyViewIndex, string systemNumber, string zoom) + { + var client = new MongoClient(); +<<<<<<< HEAD + var db = client.GetDatabase("aia"); +======= + var db = client.GetDatabase("AIAHTML5"); +>>>>>>> 0251baa2b1e5cd15177e87c3de034dde7b1f03fb + + var col = db.GetCollection("DAImages"); + + 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)) }}, + new BsonDocument { {"$project", new BsonDocument() + .Add("_id", 0) + .Add("terms", 1) + .Add("bodyRegionId", 1) + } } + }; + + + var pixelData = col.Aggregate(pipeline).ToList(); + + return pixelData.ToJson(); + } +<<<<<<< HEAD +} +======= + catch (Exception e) + { + string error = e.Message+"..STACKTRACE: "+e.StackTrace; + return error; + } + } +} +>>>>>>> 0251baa2b1e5cd15177e87c3de034dde7b1f03fb +} -- libgit2 0.21.4