|
@@ -59,7 +59,7 @@ namespace TEAMModelOS.Controllers
|
|
|
if (string.IsNullOrEmpty(classroom.id))
|
|
|
{
|
|
|
if (classroom.graduate != 0) {
|
|
|
- return BadRequest("已毕业的班级不能被编辑");
|
|
|
+ return Ok(new { error = 409, V = "已毕业的班级不能被编辑!" });
|
|
|
}
|
|
|
List<string> resultIds = new List<string>();
|
|
|
await foreach (var item in client.GetContainer(Constant.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(classroom.code) }))
|
|
@@ -91,7 +91,7 @@ namespace TEAMModelOS.Controllers
|
|
|
Class @class = json.ToObject<Class>();
|
|
|
if (classroom.graduate != 0)
|
|
|
{
|
|
|
- return BadRequest("已毕业的班级不能被编辑");
|
|
|
+ return Ok(new { error = 409, V = "已毕业的班级不能被编辑!" });
|
|
|
}
|
|
|
if (!@class.no.Equals(classroom.no))
|
|
|
{
|
|
@@ -240,7 +240,7 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
Class clssz = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<Class>($"{id}", new PartitionKey($"Class-{code}"));
|
|
|
if (clssz.graduate == 1) {
|
|
|
- return BadRequest("已毕业的班级不能被删除。");
|
|
|
+ return Ok(new { error = 409, V = "已毕业的班级不能被编辑!" });
|
|
|
}
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
List<Student> students = new List<Student>();
|