protected override async Task DeleteExecuteAsync(List <int> ids)
        {
            var defs = await _behavior.Definitions();

            int jvDefinitionId = defs.ManualJournalVouchersDefinitionId;

            foreach (var(id, index) in ids.Indexed())
            {
                if (id == jvDefinitionId)
                {
                    string path = $"[{index}]";
                    string msg  = _localizer["Error_CannotModifySystemItem"];

                    ModelState.AddError(path, msg);
                }
            }

            DeleteOutput result = await _behavior.Repository.DocumentDefinitions__Delete(
                ids : ids,
                validateOnly : ModelState.IsError,
                top : ModelState.RemainingErrors,
                userId : UserId);

            AddErrorsAndThrowIfInvalid(result.Errors);
        }
        protected override async Task DeleteExecuteAsync(List <int> ids)
        {
            DeleteOutput result = await _behavior.Repository.DashboardDefinitions__Delete(
                ids : ids,
                validateOnly : ModelState.IsError,
                top : ModelState.RemainingErrors,
                userId : UserId);

            AddErrorsAndThrowIfInvalid(result.Errors);
        }
Beispiel #3
0
        protected override async Task DeleteWithDescendantsAsync(List <int> ids)
        {
            DeleteOutput result = await _behavior.Repository.AccountTypes__DeleteWithDescendants(
                ids : ids,
                validateOnly : ModelState.IsError,
                top : ModelState.RemainingErrors,
                userId : UserId);

            AddErrorsAndThrowIfInvalid(result.Errors);
        }