|
@@ -157,10 +157,10 @@ namespace TEAMModelBI.Controllers.ProductAnalysis
|
|
|
{
|
|
|
string tmid = obj.GetProperty("id").ToString();
|
|
|
string schoolId = string.Empty;
|
|
|
- var schoolCode = Convert.ToString(obj.GetProperty("schoolCode"));
|
|
|
- var schoolCodeW = Convert.ToString(obj.GetProperty("schoolCodeW"));
|
|
|
+ var schoolCode = (obj.TryGetProperty("schoolCode", out JsonElement _schoolCode)) ? Convert.ToString(_schoolCode) : string.Empty;
|
|
|
+ var schoolCodeW = (obj.TryGetProperty("schoolCodeW", out JsonElement _schoolCodeW)) ? Convert.ToString(_schoolCodeW) : string.Empty;
|
|
|
if (!string.IsNullOrWhiteSpace(schoolCode)) schoolId = schoolCode;
|
|
|
- else if(!string.IsNullOrWhiteSpace(schoolCodeW)) schoolId = schoolCodeW;
|
|
|
+ else if (!string.IsNullOrWhiteSpace(schoolCodeW)) schoolId = schoolCodeW;
|
|
|
if (!string.IsNullOrWhiteSpace(schoolId))
|
|
|
{
|
|
|
tmidSchidDic.Add(tmid, schoolId);
|