コード例 #1
0
        public async Task UpdateWithMoveAsync()
        {
            var root = createTestData();
            await _crudAppService.CreateAsync(root);

            var listAfterCreated = await _crudAppService.GetListAsync(new Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto()
            {
                MaxResultCount = 1000
            });

            var source     = listAfterCreated.Items.Single(x => x.Code == "00001.00001");
            var sourceName = source.DisplayName;
            var target     = listAfterCreated.Items.Single(x => x.Code == "00001.00010.00001");
            var targetName = target.DisplayName;
            var updateDto  = new UpdateOrganizationUnitDto()
            {
                Code        = source.Code,
                Level       = source.Level,
                DisplayName = source.DisplayName,
                ParentId    = target.Id
            };
            await _crudAppService.UpdateAsync(source.Id, updateDto);

            var listAfterUpdated = await _crudAppService.GetListAsync(new Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto()
            {
                MaxResultCount = 1000
            });

            var toCheckSource = listAfterUpdated.Items.Single(x => x.DisplayName == sourceName);
            var toCheckTarget = listAfterUpdated.Items.Single(x => x.DisplayName == targetName);

            toCheckSource.ParentId.ShouldBe(toCheckTarget.Id);
        }
コード例 #2
0
 public async Task UpdateDisplayName(UpdateOrganizationUnitDto input)
 {
     await _organizationManager.UpdateDisplayNameAsync(input.Id, input.DisplayName);
 }