讲师维护——需要设定有效期(增加字段有效期起、有效期讫)

master
xiaochanghai 4 months ago
parent 6e739b6412
commit 89db61a986
  1. 8
      Tiobon.Core.Services/Ghre/Ghre_TeacherServices.cs

@ -192,6 +192,9 @@ FROM (SELECT A.*,
public override async Task<long> Add(InsertGhre_TeacherInput entity) public override async Task<long> Add(InsertGhre_TeacherInput entity)
{ {
if (entity.EffectiveDate != null && entity.ExpirationDate != null)
if (entity.EffectiveDate > entity.ExpirationDate)
throw new Exception($"失效日期必须大于生效日期!");
if (entity.TeacherType == "In") if (entity.TeacherType == "In")
{ {
@ -241,6 +244,11 @@ FROM (SELECT A.*,
public override async Task<bool> Update(long Id, EditGhre_TeacherInput editModel) public override async Task<bool> 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") if (editModel.TeacherType == "In")
{ {
editModel.SchoolId = null; editModel.SchoolId = null;

Loading…
Cancel
Save