|
|
@ -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); |
|
|
|
} |
|
|
|
|
|
|
|