コード例 #1
0
        private async Task InitializeAsync(DualTransaction transaction)
        {
            sourceTransaction = transaction.Decrease;
            sourceSegment     = await mapRepository.GetSegmentAsync(transaction.Decrease.StorageId);

            destinationSegment = await mapRepository.GetSegmentAsync(transaction.Increase.StorageId);
        }
コード例 #2
0
        public async Task ValidateAsync(DualTransaction transaction)
        {
            await InitializeAsync(transaction);

            if (IsCurrentUserNotSourceStorageOwnerOrSystem)
            {
                throw new NotAuthorizedException();
            }

            if (!SourceAndDestinationAtOneSegment)
            {
                throw new ValidationException();
            }
        }
コード例 #3
0
        private void InitializeTransaction()
        {
            var item = new Item(data.ItemName, data.ItemCount.Value);

            transaction = new DualTransaction(data.FromStorageId, data.ToStorageId, item);
        }