Commit 3aef1e2b37957bd93bace598d2c6af7af8dfefd5

Authored by Nikita Kulshreshtha
1 parent bb73a96e

added id in module array.

350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Custom.cs
@@ -51,6 +51,26 @@ namespace SQLToJSON @@ -51,6 +51,26 @@ namespace SQLToJSON
51 List<dynamic> RESULT = new List<dynamic>(); 51 List<dynamic> RESULT = new List<dynamic>();
52 try 52 try
53 { 53 {
  54 + Dictionary<string,string> moduleIds = new Dictionary<string,string>();
  55 + moduleIds.Add("Dissectible Anatomy", "1");
  56 + moduleIds.Add("Atlas Anatomy", "2");
  57 + moduleIds.Add("3D Anatomy", "3");
  58 + moduleIds.Add("Clinical Illustrations", "4");
  59 + moduleIds.Add("Clinical Animations", "5");
  60 + moduleIds.Add("Encyclopedia", "6");
  61 + moduleIds.Add("Curriculum Builder", "7");
  62 + moduleIds.Add("Anatomy Test", "8");
  63 + moduleIds.Add("IP 10", "9");
  64 + moduleIds.Add("Lab Exercises", "10");
  65 + moduleIds.Add("In-Depth Reports", "11");
  66 + moduleIds.Add("CAM", "12");
  67 + moduleIds.Add("A.D.A.M. Images", "13");
  68 + moduleIds.Add("Body Guide", "14");
  69 + moduleIds.Add("Symptom Navigator", "15");
  70 + moduleIds.Add("The Wellness Tools", "16");
  71 + moduleIds.Add("A.D.A.M. OnDemand", "1017");
  72 + // moduleIds.Add("Dissectible Anatomy", "1");
  73 +
54 74
55 List<User> data = (from d in userTable.AsEnumerable() 75 List<User> data = (from d in userTable.AsEnumerable()
56 join e in moduleTable.AsEnumerable() 76 join e in moduleTable.AsEnumerable()
@@ -72,7 +92,8 @@ namespace SQLToJSON @@ -72,7 +92,8 @@ namespace SQLToJSON
72 modifierId = d.Field<int>("modifierId"), 92 modifierId = d.Field<int>("modifierId"),
73 modifiedDate = d.Field<DateTime?>("modifiedDate"), 93 modifiedDate = d.Field<DateTime?>("modifiedDate"),
74 deactivationDate = d.Field<DateTime?>("deactivationDate"), 94 deactivationDate = d.Field<DateTime?>("deactivationDate"),
75 - module = e.Field<string>("Title"),//JsonConvert.SerializeObject(e.Field<string>("Title")), 95 + module = e.Field<string>("Title"),
  96 + //JsonConvert.SerializeObject(e.Field<string>("Title")),
76 }).ToList(); 97 }).ToList();
77 98
78 99
@@ -100,6 +121,7 @@ namespace SQLToJSON @@ -100,6 +121,7 @@ namespace SQLToJSON
100 { 121 {
101 dynamic modul = new JObject(); 122 dynamic modul = new JObject();
102 string MO = mods.ToString().Replace(@"\", ""); 123 string MO = mods.ToString().Replace(@"\", "");
  124 + modul.id = moduleIds[mods];
103 if (MO == "CAM") 125 if (MO == "CAM")
104 { 126 {
105 modul.name = "Complementary and Alternative Medicine"; 127 modul.name = "Complementary and Alternative Medicine";
350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/Form1.cs
@@ -30,7 +30,7 @@ namespace SQLToJSON @@ -30,7 +30,7 @@ namespace SQLToJSON
30 + " U.ModifiedDate as modifiedDate, U.DeactivationDate as deactivationDate FROM AIAUser U,UserType UT, SecurityQuestion sq" 30 + " U.ModifiedDate as modifiedDate, U.DeactivationDate as deactivationDate FROM AIAUser U,UserType UT, SecurityQuestion sq"
31 + " WHERE U.UserTypeId = UT.Id and U.SecurityQuestionId = sq.Id"; 31 + " WHERE U.UserTypeId = UT.Id and U.SecurityQuestionId = sq.Id";
32 32
33 - string userModulesQuery = "select distinct ule.UserId,mt.ModuleId,rm.Title from LicenseToEdition le,AIAUserToLicenseEdition ule," 33 + string userModulesQuery = "select distinct ule.UserId,mt.ModuleId,rm.Title,rm.Id as id from LicenseToEdition le,AIAUserToLicenseEdition ule,"
34 + " ModuleToLicense mt, ResourceModule rm where le.LicenseId = ule.LicenseEditionId and le.LicenseId=mt.LicenseId" 34 + " ModuleToLicense mt, ResourceModule rm where le.LicenseId = ule.LicenseEditionId and le.LicenseId=mt.LicenseId"
35 + " and rm.Id = mt.ModuleId order by ule.UserId,mt.ModuleId"; 35 + " and rm.Id = mt.ModuleId order by ule.UserId,mt.ModuleId";
36 36