Exemple #1
0
        public async Task <IActionResult> Add(OrderLineAddViewModel orderLineAddViewModel)
        {
            orderLineAddViewModel.OrderLineDto.OrderHeaderId = orderLineAddViewModel.OrderHeaderId;
            var orderLine = _mapper.Map <OrderLine>(orderLineAddViewModel.OrderLineDto);

            var result = await _orderLineService.AddOrderLineWithCalculateHeaderAmountAsync(orderLine);

            if (result.Status == Status.Success)
            {
                return(RedirectToAction("GetLines", "Home", new { orderLineAddViewModel.OrderHeaderId }));
            }

            return(RedirectToAction("Index", "Home"));
        }