【唯亚威】必选修规则 新增直接删除关联学习记录

master
xiaochanghai 4 months ago
parent 9d1b93a60b
commit 06414c9bdc
  1. 9
      Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs

@ -657,9 +657,12 @@ public class Ghre_StudyRuleServices : BaseServices<Ghre_StudyRule, Ghre_StudyRul
/// <returns></returns> /// <returns></returns>
public override async Task<bool> DeleteById1(object id) public override async Task<bool> DeleteById1(object id)
{ {
var companyCode = await QueryCompanyCode();
if (await Db.Queryable<Ghre_StudyRecord>().AnyAsync(x => x.StudyRuleId == id.ObjToLong() && x.StudyStatus != Consts.DIC_STUDY_RECORD_STUDY_STATUS.NO_JOIN)) if (companyCode != "Viavi")
throw new Exception($"有学员已经学习,暂不可作废!"); {
if (await Db.Queryable<Ghre_StudyRecord>().AnyAsync(x => x.StudyRuleId == id.ObjToLong() && x.StudyStatus != Consts.DIC_STUDY_RECORD_STUDY_STATUS.NO_JOIN))
throw new Exception($"有学员已经学习,暂不可作废!");
}
await Db.Updateable<Ghre_StudyRecord>() await Db.Updateable<Ghre_StudyRecord>()
.SetColumns(it => new Ghre_StudyRecord() .SetColumns(it => new Ghre_StudyRecord()

Loading…
Cancel
Save