|
|
|
@ -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() |
|
|
|
|