|
@@ -652,10 +652,12 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
List<object> subjects = new List<object>();
|
|
|
List<object> examTypes = new List<object>();
|
|
|
|
|
|
+ string lang = "en-us";
|
|
|
School school_base = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>($"{school_code}", new PartitionKey("Base"));
|
|
|
if (!string.IsNullOrWhiteSpace(school_base.id))
|
|
|
{
|
|
|
- foreach(Period periodinfo in school_base.period)
|
|
|
+ lang = (school_base.region.Equals("中国")) ? "zh-cn" : (school_base.region.Equals("臺灣")) ? "zh-tw" : "en-us"; //語系
|
|
|
+ foreach (Period periodinfo in school_base.period)
|
|
|
{
|
|
|
periods.Add(new { id= periodinfo.id, name= periodinfo.name });
|
|
|
int gradeIndex = 0;
|
|
@@ -756,11 +758,12 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
if(!string.IsNullOrWhiteSpace(gradeInfo.id))
|
|
|
{
|
|
|
classExtobj.gradeId = gradeInfo.id;
|
|
|
- classExtobj.gradeName = gradeInfo.name;
|
|
|
+ if(gradeInfo.name.Equals("graduated")) classExtobj.gradeName = (lang.Equals("zh-cn")) ? "已毕业" : (lang.Equals("zh-tw")) ? "已畢業" : "Graduated";
|
|
|
+ else if(gradeInfo.name.Equals("not-enrollment")) classExtobj.gradeName = (lang.Equals("zh-cn")) ? "未到入学时间" : (lang.Equals("zh-tw")) ? "未到入學時間" : "It is not time for enrollment yet";
|
|
|
+ else classExtobj.gradeName = gradeInfo.name;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
//選課班 (過期者不選)
|
|
@@ -1929,16 +1932,8 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
curYear--;
|
|
|
}
|
|
|
int gradeIndex = curYear - year;
|
|
|
- if (gradeIndex >= curPeriod.grades.Count)
|
|
|
- {
|
|
|
- result.id = gradeIndex.ToString();
|
|
|
- result.name = "graduated";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- result.id = gradeIndex.ToString();
|
|
|
- result.name = curPeriod.grades[gradeIndex];
|
|
|
- }
|
|
|
+ result.id = gradeIndex.ToString();
|
|
|
+ result.name = (gradeIndex >= curPeriod.grades.Count) ? "graduated" : (gradeIndex >= 0) ? curPeriod.grades[gradeIndex] : "not-enrollment";
|
|
|
}
|
|
|
}
|
|
|
return result;
|