コード例 #1
0
        public DocumentPosition Map(AddDocumentPositionRequest request)
        {
            if (request == null)
            {
                return(null);
            }

            DocumentPosition documentPosition = new DocumentPosition
            {
                PositionNumberText = request.PositionNumberText,
                ArticleNameExtern  = request.ArticleNameExtern,
                Quantity           = request.Quantity,
                ScaleUnitQty       = request.ScaleUnitQty,
                ScaleUnitType      = request.ScaleUnitType,
                ScaleUnit          = request.ScaleUnit,
                DeliveryQty        = request.DeliveryQty,
                IsPartialDelivered = request.IsPartialDelivered,
                PriceBase          = request.PriceBase,
                PricePerUnit       = request.PricePerUnit,
                PriceTotal         = request.PricePerUnit,
                SalesTaxPercent    = request.SalesTaxPercent,
                ParentId           = request.ParentId,
                DocumentId         = request.DocumentId,
                ArticleId          = request.ArticleId,
            };

            return(documentPosition);
        }
コード例 #2
0
        public async Task <DocumentPositionResponse> AddDocumentPositionAsync(AddDocumentPositionRequest request)
        {
            DocumentPosition documentPosition = _documentPositionMapper.Map(request);
            DocumentPosition result           = _documentPositionRespository.Add(documentPosition);

            int modifiedRecords = await _documentPositionRespository.UnitOfWork.SaveChangesAsync();

            _logger.LogInformation(Events.Add, Messages.NumberOfRecordAffected_modifiedRecords, modifiedRecords);
            _logger.LogInformation(Events.Add, Messages.ChangesApplied_id, result?.Id);

            return(_documentPositionMapper.Map(result));
        }