|
@@ -185,7 +185,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
//}
|
|
|
|
|
|
var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("AreaSetting"));
|
|
|
- if (responseSet.Status == 200)
|
|
|
+ if (responseSet.StatusCode == System.Net.HttpStatusCode.OK)
|
|
|
{
|
|
|
using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
|
|
|
AreaSetting delSet = fileJson.ToObject<AreaSetting>();
|
|
@@ -291,7 +291,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
|
|
|
Teacher teacher = new();
|
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
|
|
|
- if (response.Status == 200)
|
|
|
+ if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
|
teacher = json.ToObject<Teacher>();
|
|
@@ -331,11 +331,11 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
foreach (var item in schoolMs)
|
|
|
{
|
|
|
var resSc = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{item.id}", new PartitionKey($"Base"));
|
|
|
- if (resSc.Status == 200)
|
|
|
+ if (resSc.StatusCode == System.Net.HttpStatusCode.OK)
|
|
|
{
|
|
|
SchoolTeacher schoolTeacher = null;
|
|
|
var resScTch = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{item.id}"));
|
|
|
- if (resScTch.Status == 200)
|
|
|
+ if (resScTch.StatusCode == System.Net.HttpStatusCode.OK)
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(resScTch.Content);
|
|
|
schoolTeacher = json.ToObject<SchoolTeacher>();
|
|
@@ -443,7 +443,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
|
|
|
Teacher teacher = null;
|
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
|
|
|
- if (response.Status == 200)
|
|
|
+ if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
|
teacher = json.ToObject<Teacher>();
|
|
@@ -496,7 +496,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
areaSchool.ForEach(async areaSc =>
|
|
|
{
|
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(areaSc.id, new PartitionKey("ProductSum"));
|
|
|
- if (response.Status == 200)
|
|
|
+ if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
|
if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
|