diff --git a/Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs b/Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs index 4b3c837d..786e4168 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs @@ -192,6 +192,9 @@ FROM (SELECT A.*, public override async Task Add(InsertGhre_TeacherInput entity) { + if (entity.EffectiveDate != null && entity.ExpirationDate != null) + if (entity.EffectiveDate > entity.ExpirationDate) + throw new Exception($"失效日期必须大于生效日期!"); if (entity.TeacherType == "In") { @@ -241,6 +244,11 @@ FROM (SELECT A.*, public override async Task Update(long Id, EditGhre_TeacherInput editModel) { + + if (editModel.EffectiveDate != null && editModel.ExpirationDate != null) + if (editModel.EffectiveDate > editModel.ExpirationDate) + throw new Exception($"失效日期必须大于生效日期!"); + if (editModel.TeacherType == "In") { editModel.SchoolId = null;