diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 7a851bf8..d6bccdfd 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -895,11 +895,16 @@ public class Ghre_ExamRecordServices : BaseServices= (exampaper.RetakeTimes ?? 0)) return ServiceResult.OprateFailed($"重考次数已达上限,已重考次数【{entity.RetakeTimes ?? 0}】,允许重考次数【{exampaper.RetakeTimes ?? 0}】!"); - if (entity.Status == Consts.DIC_EXAM_RECORD_STATUS.EXAM_END) - entity.Status = Consts.DIC_EXAM_RECORD_STATUS.EXAMING; + if (entity.Status == DIC_EXAM_RECORD_STATUS.EXAM_END) + entity.Status = DIC_EXAM_RECORD_STATUS.EXAMING; entity.RetakeTimes = entity.RetakeTimes is null ? 1 : entity.RetakeTimes + 1; - entity.ScoreStatus = Consts.DIC_EXAM_RECORD_SCORE_STATUS.NO_SCORE; + entity.ScoreStatus = DIC_EXAM_RECORD_SCORE_STATUS.NO_SCORE; + + var sql = $@"UPDATE Ghre_ExamRecordDetail SET IsEnable=0 WHERE ExamRecordId='{entity.Id}'; + UPDATE Ghre_ExamRecordAnswer SET IsEnable=0 WHERE ExamRecordId='{entity.Id}';"; + + await Db.Ado.ExecuteCommandAsync(sql); await Update(entity, new List() {