Exemple #1
0
        public async Task <CountResult> CancelPublishAsync(long[] BillingInputIds, CancellationToken token = default(CancellationToken))
        {
            using (var scope = transactionScopeBuilder.Create())
            {
                var result = new CountResult()
                {
                    ProcessResult = new ProcessResult(), Count = 0
                };

                await billingProcessor.UpdateForResetInvoiceCodeAsync(BillingInputIds, token);

                await billingProcessor.UpdateForResetInputIdAsync(BillingInputIds, token);

                var deleteCount = await billingInputProcessor.DeleteForCancelPublishAsync(BillingInputIds, token);

                var resetCount = await billingInputProcessor.UpdateForCancelPublishAsync(BillingInputIds, token);

                result.Count = (deleteCount + resetCount);
                result.ProcessResult.Result = (result.Count == BillingInputIds.Count());
                if (result.ProcessResult.Result)
                {
                    scope.Complete();
                }

                return(result);
            }
        }