Commit 350b9ddd6fbc31bfd61be182c6409e6991f7f918
1 parent
84699776
added sql.id also as mongo.oldId
Showing
2 changed files
with
11 additions
and
6 deletions
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