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

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>
public override async Task<bool> DeleteById1(object id)
{
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($"有学员已经学习,暂不可作废!");
var companyCode = await QueryCompanyCode();
if (companyCode != "Viavi")
{
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>()
.SetColumns(it => new Ghre_StudyRecord()

Loading…
Cancel
Save