public void Execute(OrderDispatchApprovedLineItemsCommand command)
        {
            _log.InfoFormat("Execute {1} - Command Id {0} ", command.CommandId, command.GetType().ToString());
            try
            {

                if (!DocumentExists(command.DocumentId))
                    return;
               
                var doc = _cokeDataContext.tblDocument.FirstOrDefault(s => s.Id == command.DocumentId);
                foreach (var tblLine in doc.tblLineItems.Where(s=>s.LineItemStatusId==(int)MainOrderLineItemStatus.Approved))
                {
                    tblLine.LineItemStatusId = (int)MainOrderLineItemStatus.Dispatched;
                    tblLine.DispatchedQuantity = tblLine.ApprovedQuantity;

                }
                //doc.OrderStatusId = (int)OrderStatus.Inprogress;
                _cokeDataContext.SaveChanges();
                
            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Error Execute {1} - Command Id {0} ", command.CommandId, command.GetType().ToString());
                _log.Error("OrderDispatchedToPhoneCommandHandler exception", ex);
                throw ;
            }
        }
Exemplo n.º 2
0
 public void Handle(OrderDispatchApprovedLineItemsCommand command)
 {
     var order = GetOrder();
     order.ProcessingStatus = ProcessingStatus.Deliverable;
 }