|
@@ -91,7 +91,7 @@ namespace TEAMModelOS.Controllers
|
|
|
else
|
|
|
{*/
|
|
|
List<string> resultIds = new List<string>();
|
|
|
- await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.periodId = '{classroom.periodId}' and c.no = '{classroom.no}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
|
|
|
+ await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.periodId = '{classroom.periodId}' and c.no = '{classroom.no}' and c.year = '{classroom.year}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
@@ -133,7 +133,7 @@ namespace TEAMModelOS.Controllers
|
|
|
if (!@class.no.Equals(classroom.no))
|
|
|
{
|
|
|
List<string> resultIds = new List<string>();
|
|
|
- await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.periodId = '{classroom.periodId}' and c.no = '{classroom.no}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
|
|
|
+ await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.year = '{classroom.year}' and c.no = '{classroom.no}' and c.periodId = '{classroom.periodId}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
|
|
|
{
|
|
|
using var document = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
if (document.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|