|
@@ -876,24 +876,24 @@ namespace TEAMModelOS.Controllers
|
|
|
)
|
|
|
);
|
|
|
}
|
|
|
- else if(dicClassStuds.ContainsKey(classId))
|
|
|
- {
|
|
|
- Console.WriteLine(acc.ToJsonString());
|
|
|
- dicClassStuds[classId].Add(
|
|
|
- (
|
|
|
- acc.GetProperty("id").GetString(),
|
|
|
- acc.GetProperty("name").GetString(),
|
|
|
- acc.GetProperty("picture").GetString(),
|
|
|
- acc.GetProperty("year").GetInt32(),
|
|
|
- acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId",out JsonElement _periodId)&& _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- dicClassStuds.Add(classId,
|
|
|
- new List<(string id, string name, string pic, int year, string no,string periodId)>()
|
|
|
- {
|
|
|
+ else {
|
|
|
+ if (dicClassStuds.ContainsKey(classId))
|
|
|
+ {
|
|
|
+ dicClassStuds[classId].Add(
|
|
|
+ (
|
|
|
+ acc.GetProperty("id").GetString(),
|
|
|
+ acc.GetProperty("name").GetString(),
|
|
|
+ acc.GetProperty("picture").GetString(),
|
|
|
+ acc.GetProperty("year").GetInt32(),
|
|
|
+ acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dicClassStuds.Add(classId,
|
|
|
+ new List<(string id, string name, string pic, int year, string no, string periodId)>()
|
|
|
+ {
|
|
|
(
|
|
|
acc.GetProperty("id").GetString(),
|
|
|
acc.GetProperty("name").GetString(),
|
|
@@ -901,8 +901,9 @@ namespace TEAMModelOS.Controllers
|
|
|
acc.GetProperty("year").GetInt32(),
|
|
|
acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId",out JsonElement _periodId)&& _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null
|
|
|
)
|
|
|
- }
|
|
|
- );
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -924,8 +925,7 @@ namespace TEAMModelOS.Controllers
|
|
|
classId = classInfos[classStud.Key].GetProperty("id").GetString();
|
|
|
classNo = classInfos[classStud.Key].GetProperty("no").GetString();
|
|
|
className = classInfos[classStud.Key].GetProperty("name").GetString();
|
|
|
- //gradeId = classInfos[classStud.Key].GetProperty("gradeId").GetString();
|
|
|
- periodId = classInfos[classStud.Key].GetProperty("periodId").ValueKind.Equals(JsonValueKind.String)? classInfos[classStud.Key].GetProperty("periodId").GetString():null;
|
|
|
+ periodId = classInfos[classStud.Key].TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null ;
|
|
|
if (classInfos[classStud.Key].TryGetProperty("year", out JsonElement year)) {
|
|
|
if (year.ValueKind.Equals(JsonValueKind.Number)) {
|
|
|
classYear = classInfos[classStud.Key].GetProperty("year").GetInt32();
|
|
@@ -945,7 +945,7 @@ namespace TEAMModelOS.Controllers
|
|
|
classNo,
|
|
|
className,
|
|
|
gradeId,
|
|
|
- periodId,
|
|
|
+ periodId= string.IsNullOrEmpty(periodId)? o.periodId: periodId,
|
|
|
classYear
|
|
|
|
|
|
});
|
|
@@ -965,7 +965,7 @@ namespace TEAMModelOS.Controllers
|
|
|
classNo = (string)null,
|
|
|
className = (string)null,
|
|
|
gradeId = (string)null,
|
|
|
- periodId = o.periodId,
|
|
|
+ o.periodId,
|
|
|
classYear = -1
|
|
|
}));
|
|
|
|