Browse Source

修改动态档案的删除功能

Branch_JinYang
xusc 8 months ago
parent
commit
b7b6080d87
  1. 28
      src/aspnet-core/ICS.Application/Business/Service/基础设置/SysEnumKey/SysEnumKeyAppService.cs

28
src/aspnet-core/ICS.Application/Business/Service/基础设置/SysEnumKey/SysEnumKeyAppService.cs

@ -159,19 +159,37 @@ namespace ICS.Application.Business.Service
[AbpAuthorize(SysEnumKeyPermissions.SysEnumKey_Delete)]
public async Task Delete(EntityDto<long> input)
{
await _sysEnumKeyManager.DeleteAsync(input.Id);
var entity = _repository.Get(input.Id);
if (entity != null)
var entity = await _repository.GetAsync(input.Id);
if (entity == null)
{
//删除子表
_derepository.Delete(x => x.EnumKey == entity.EnumKey);
throw new UserFriendlyException(L("NoExistsCurrentCode", "xx"));
}
#region //删除验证
//删除子表
_derepository.Delete(x => x.EnumKey == entity.EnumKey);
#endregion
await _sysEnumKeyManager.DeleteAsync(input.Id);
}
[AbpAuthorize(SysEnumKeyPermissions.SysEnumKey_BatchDelete)]
public async Task BatchDelete(List<long> input)
{
var entitys = await _repository.GetAllListAsync(x => input.Contains(x.Id));
if (entitys == null)
{
throw new UserFriendlyException(L("NoExistsCurrentCode", "xx"));
}
#region //删除验证
foreach (var item in entitys)
{
//删除子表
_derepository.Delete(x => x.EnumKey == item.EnumKey);
}
#endregion
await _sysEnumKeyManager.BatchDelete(input);
}

Loading…
Cancel
Save