Exemplo n.º 1
0
 /// <summary>
 /// 运维专用:删除特定租户下的某一组织
 /// </summary>
 /// <param name="tenantId"></param>
 /// <param name="input"></param>
 /// <returns></returns>
 public async Task DeleteOrgUnitInTenantAsync(int tenantId, EntityDto <long> input)
 {
     using (CurrentUnitOfWork.SetTenantId(tenantId))
     {
         await _orgUnitManager.DeleteAsync(input.Id);
     }
 }
Exemplo n.º 2
0
    public async Task DeleteAsync()
    {
        var ou = await _organizationUnitRepository.GetAsync("OU11");

        await _organizationUnitManager.DeleteAsync(ou.Id);

        (await _organizationUnitRepository.GetAsync("OU11")).ShouldBeNull();
    }
        public virtual async Task DeleteAsync(Guid id)
        {
            var ou = await OrganizationUnitRepository.GetAsync(id, false);

            await AuthorizationService.CheckAsync(ou, CommonOperations.Delete);

            await OrganizationUnitManager.DeleteAsync(ou.Id);
        }
 public async Task DeleteOrganizationUnit(long id)
 {
     if (await IsOrganizationInUse(id))
     {
         throw new UserFriendlyException(L("Err_OrganizationInUse"));
     }
     await _organizationUnitManager.DeleteAsync(id);
 }
Exemplo n.º 5
0
        public async Task DeleteOrganizationUnit(EntityDto <long> input)
        {
            await _userOrganizationUnitRepository.DeleteAsync(x => x.OrganizationUnitId == input.Id);

            await _organizationUnitRoleRepository.DeleteAsync(x => x.OrganizationUnitId == input.Id);

            await _organizationUnitManager.DeleteAsync(input.Id);
        }
Exemplo n.º 6
0
        /// <inheritdoc/>
        public async Task DeleteOrganizationUnit(List <IdInput> input)
        {
            var ids = input.Select(p => p.Id);

            foreach (var id in ids)
            {
                await _organizationUnitManager.DeleteAsync(id);
            }
        }
Exemplo n.º 7
0
        public virtual async Task DeleteAsync(Guid id)
        {
            var origanizationUnit = await OrganizationUnitRepository.FindAsync(id);

            if (origanizationUnit == null)
            {
                return;
            }
            await OrganizationUnitManager.DeleteAsync(id);
        }
Exemplo n.º 8
0
        public virtual async Task DeleteOrganizationUnitAsync(long Id)
        {
            var entity = _organizationUnitRepository.Get(Id);

            if (entity.IsStatic())
            {
                throw new Exception("The static organizations can not be deleted!");
            }
            await _organizationUnitManager.DeleteAsync(Id);
        }
 public async Task DeleteOrganizationUnit(EntityDto <long> input)
 {
     //DeleteWeChatOrganizationInput wechat = new DeleteWeChatOrganizationInput
     //{
     //    Id = input.Id,
     //    value = "Mail"
     //};
     //BackgroundJob.Schedule<IQYWechatAppService>(x => x.DeleteWeChatOrganization(wechat), TimeSpan.FromMinutes(5));
     await _organizationUnitManager.DeleteAsync(input.Id);
 }
Exemplo n.º 10
0
        public async Task Should_Delete_UO_With_Children()
        {
            //Arrange
            var ou11 = GetOU("OU11");

            //Act
            await _organizationUnitManager.DeleteAsync(ou11.Id);

            //Assert
            GetOU("OU11").IsDeleted.ShouldBeTrue();
            GetOU("OU111").IsDeleted.ShouldBeTrue();
            GetOU("OU112").IsDeleted.ShouldBeTrue();
        }
Exemplo n.º 11
0
 public async Task DeleteAsync(Guid id)
 {
     await OrganizationUnitManager.DeleteAsync(id);
 }
Exemplo n.º 12
0
 public async Task DeleteOrganizationUnit(long input)
 {
     await _organizationUnitManager.DeleteAsync(input);
 }
 public async Task RemoveOrganizationUnit(long id)
 {
     await _organizationUnitManager.DeleteAsync(id);
 }
 public async Task DeleteOrganizationUnit(NullableIdDto <long> input)
 {
     await _organizationUnitManager.DeleteAsync(input.Id.Value);
 }
Exemplo n.º 15
0
 public override async Task Delete(EntityDto <long> input)
 {
     CheckDeletePermission();
     await _organizationUnitManager.DeleteAsync(input.Id);
 }
Exemplo n.º 16
0
 public async Task DeleteAsync(long id)
 {
     await(_entityManager.DeleteAsync(id));
 }
 public async Task DeleteOrganizationUnit(EntityDto <long> input)
 {
     await _organizationUnitManager.DeleteAsync(input.Id);
 }
Exemplo n.º 18
0
 /// <summary>
 /// 删除当前租户下的特定组织
 /// </summary>
 /// <param name="input"></param>
 /// <returns></returns>
 public async Task DeleteAsync(EntityDto <long> input)
 {
     await _orgUnitManager.DeleteAsync(input.Id);
 }