From 3aef1e2b37957bd93bace598d2c6af7af8dfefd5 Mon Sep 17 00:00:00 2001 From: nikita Date: Thu, 2 Mar 2017 16:23:34 +0530 Subject: [PATCH] added id in module array. --- 350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Custom.cs | 24 +++++++++++++++++++++++- 350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Form1.cs | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Custom.cs b/350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Custom.cs index e9d5d97..4de0313 100644 --- a/350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Custom.cs +++ b/350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Custom.cs @@ -51,6 +51,26 @@ namespace SQLToJSON List RESULT = new List(); try { + Dictionary moduleIds = new Dictionary(); + moduleIds.Add("Dissectible Anatomy", "1"); + moduleIds.Add("Atlas Anatomy", "2"); + moduleIds.Add("3D Anatomy", "3"); + moduleIds.Add("Clinical Illustrations", "4"); + moduleIds.Add("Clinical Animations", "5"); + moduleIds.Add("Encyclopedia", "6"); + moduleIds.Add("Curriculum Builder", "7"); + moduleIds.Add("Anatomy Test", "8"); + moduleIds.Add("IP 10", "9"); + moduleIds.Add("Lab Exercises", "10"); + moduleIds.Add("In-Depth Reports", "11"); + moduleIds.Add("CAM", "12"); + moduleIds.Add("A.D.A.M. Images", "13"); + moduleIds.Add("Body Guide", "14"); + moduleIds.Add("Symptom Navigator", "15"); + moduleIds.Add("The Wellness Tools", "16"); + moduleIds.Add("A.D.A.M. OnDemand", "1017"); + // moduleIds.Add("Dissectible Anatomy", "1"); + List data = (from d in userTable.AsEnumerable() join e in moduleTable.AsEnumerable() @@ -72,7 +92,8 @@ namespace SQLToJSON modifierId = d.Field("modifierId"), modifiedDate = d.Field("modifiedDate"), deactivationDate = d.Field("deactivationDate"), - module = e.Field("Title"),//JsonConvert.SerializeObject(e.Field("Title")), + module = e.Field("Title"), + //JsonConvert.SerializeObject(e.Field("Title")), }).ToList(); @@ -100,6 +121,7 @@ namespace SQLToJSON { dynamic modul = new JObject(); string MO = mods.ToString().Replace(@"\", ""); + modul.id = moduleIds[mods]; if (MO == "CAM") { modul.name = "Complementary and Alternative Medicine"; diff --git a/350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Form1.cs b/350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Form1.cs index cae26f6..c5ece98 100644 --- a/350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Form1.cs +++ b/350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Form1.cs @@ -30,7 +30,7 @@ namespace SQLToJSON + " U.ModifiedDate as modifiedDate, U.DeactivationDate as deactivationDate FROM AIAUser U,UserType UT, SecurityQuestion sq" + " WHERE U.UserTypeId = UT.Id and U.SecurityQuestionId = sq.Id"; - string userModulesQuery = "select distinct ule.UserId,mt.ModuleId,rm.Title from LicenseToEdition le,AIAUserToLicenseEdition ule," + string userModulesQuery = "select distinct ule.UserId,mt.ModuleId,rm.Title,rm.Id as id from LicenseToEdition le,AIAUserToLicenseEdition ule," + " ModuleToLicense mt, ResourceModule rm where le.LicenseId = ule.LicenseEditionId and le.LicenseId=mt.LicenseId" + " and rm.Id = mt.ModuleId order by ule.UserId,mt.ModuleId"; -- libgit2 0.21.4