Пример #1
0
    private async Task SaveAsync()
    {
        try
        {
            var updateDto = new UpdatePermissionsDto
            {
                Permissions = _groups
                              .SelectMany(g => g.Permissions)
                              .Select(p => new UpdatePermissionDto {
                    IsGranted = p.IsGranted, Name = p.Name
                })
                              .ToArray()
            };

            await PermissionAppService.UpdateAsync(_providerName, _providerKey, updateDto);

            await CurrentApplicationConfigurationCacheResetService.ResetAsync();

            await InvokeAsync(_modal.Hide);
        }
        catch (Exception ex)
        {
            await HandleErrorAsync(ex);
        }
    }
Пример #2
0
        protected virtual async Task SaveAsync()
        {
            try
            {
                var features = new UpdateFeaturesDto
                {
                    Features = Groups.SelectMany(g => g.Features).Select(f => new UpdateFeatureDto
                    {
                        Name  = f.Name,
                        Value = f.ValueType is ToggleStringValueType ? ToggleValues[f.Name].ToString() :
                                f.ValueType is SelectionStringValueType ? SelectionStringValues[f.Name] : f.Value
                    }).ToList()
                };

                await FeatureAppService.UpdateAsync(ProviderName, ProviderKey, features);

                await CurrentApplicationConfigurationCacheResetService.ResetAsync();

                await InvokeAsync(Modal.Hide);
            }
            catch (Exception ex)
            {
                await HandleErrorAsync(ex);
            }
        }
Пример #3
0
    private async Task SaveAsync()
    {
        try
        {
            var updateDto = new UpdatePermissionsDto
            {
                Permissions = _groups
                              .SelectMany(g => g.Permissions)
                              .Select(p => new UpdatePermissionDto {
                    IsGranted = p.IsGranted, Name = p.Name
                })
                              .ToArray()
            };

            if (!updateDto.Permissions.Any(x => x.IsGranted))
            {
                if (!await Message.Confirm(L["RemoveAllPermissionsWarningMessage"].Value))
                {
                    return;
                }
            }

            await PermissionAppService.UpdateAsync(_providerName, _providerKey, updateDto);

            await CurrentApplicationConfigurationCacheResetService.ResetAsync();

            await InvokeAsync(_modal.Hide);
        }
        catch (Exception ex)
        {
            await HandleErrorAsync(ex);
        }
    }
    protected virtual async Task UpdateSettingsAsync()
    {
        try
        {
            await EmailSettingsAppService.UpdateAsync(ObjectMapper.Map <EmailSettingsDto, UpdateEmailSettingsDto>(EmailSettings));

            await CurrentApplicationConfigurationCacheResetService.ResetAsync();

            await UiMessageService.Success(L["SuccessfullySaved"]);
        }
        catch (Exception ex)
        {
            await HandleErrorAsync(ex);
        }
    }