Пример #1
0
 public DeliveryOrder ConfirmObject(DeliveryOrder deliveryOrder, DateTime ConfirmationDate, IDeliveryOrderDetailService _deliveryOrderDetailService,
                                    ISalesOrderService _salesOrderService, ISalesOrderDetailService _salesOrderDetailService,
                                    IStockMutationService _stockMutationService, IItemService _itemService,
                                    IBarringService _barringService, IWarehouseItemService _warehouseItemService)
 {
     deliveryOrder.ConfirmationDate = ConfirmationDate;
     if (_validator.ValidConfirmObject(deliveryOrder, _deliveryOrderDetailService))
     {
         IList <DeliveryOrderDetail> deliveryOrderDetails = _deliveryOrderDetailService.GetObjectsByDeliveryOrderId(deliveryOrder.Id);
         foreach (var detail in deliveryOrderDetails)
         {
             detail.Errors = new Dictionary <string, string>();
             _deliveryOrderDetailService.ConfirmObject(detail, ConfirmationDate, this, _salesOrderDetailService, _stockMutationService, _itemService,
                                                       _barringService, _warehouseItemService);
         }
         _repository.ConfirmObject(deliveryOrder);
         SalesOrder salesOrder = _salesOrderService.GetObjectById(deliveryOrder.SalesOrderId);
         _salesOrderService.CheckAndSetDeliveryComplete(salesOrder, _salesOrderDetailService);
     }
     return(deliveryOrder);
 }