Commit 350b9ddd6fbc31bfd61be182c6409e6991f7f918

Authored by Nikita Kulshreshtha
1 parent 84699776

added sql.id also as mongo.oldId

350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/DataAccess.cs
... ... @@ -36,13 +36,14 @@ namespace SQLToJSON
36 36 {
37 37 string JSONString = string.Empty;
38 38 JSONString = JsonConvert.SerializeObject(table);
39   - string replacedString = JSONString.Replace(@"\r", "");
40   - string replacedString1 = replacedString.Replace(@"\n", "");
41   - string replacedString2 = replacedString1.Replace(@"\", "");
  39 + // string replacedString = JSONString.Replace(@"\r", "");
  40 + // string replacedString1 = replacedString.Replace(@"\n", "");
  41 + // string replacedString2 = replacedString1.Replace(@"\", "");
42 42  
43   - string finalString = Regex.Replace(replacedString2, "\s+\"", "");
  43 + // string finalString = Regex.Replace(replacedString2, "\s+\"", "");
44 44  
45   - return finalString;
  45 + //return finalString;
  46 + return JSONString;
46 47 }
47 48  
48 49 public dynamic GetModifiedTableWithUserModules(DataTable userTable, DataTable moduleTable)
... ... @@ -78,6 +79,7 @@ namespace SQLToJSON
78 79 e.Field<int>("UserId")
79 80 select new User
80 81 {
  82 + oldId = d.Field<int>("id"),
81 83 loginId = d.Field<string>("loginId"),
82 84 password = d.Field<string>("password"),
83 85 firstName = d.Field<string>("firstName"),
... ... @@ -156,6 +158,7 @@ namespace SQLToJSON
156 158  
157 159 var lst2 = data2.Where(w => w.loginId == userloginId).Select(r => new User
158 160 {
  161 + oldId = row.oldId,
159 162 loginId = row.loginId,
160 163 password = row.password,
161 164 firstName = row.firstName,
... ... @@ -177,6 +180,7 @@ namespace SQLToJSON
177 180  
178 181  
179 182 var reultantRow = lst2.Take(1).Select(a=>new{
  183 + oldId = a.oldId,
180 184 loginId = a.loginId,
181 185 password = a.password,
182 186 firstName = a.firstName,
... ...
350-UTILITIES/SQL_To_Json/SQLToJSON/SQLToJSON/User.cs
... ... @@ -8,7 +8,8 @@ namespace SQLToJSON
8 8 {
9 9 public class User
10 10 {
11   -
  11 +
  12 + public int oldId { get; set; }
12 13 public string loginId{get;set;}
13 14 public string password { get; set; }
14 15 public string firstName { get; set; }
... ...