Ejemplo n.º 1
0
        private void OnRemoveSelectedShipmentsCommand()
        {
            using (var orderRepository = _orderRepositoryFactory.GetRepositoryInstance())
            {
                Shipments.Where(x => x.IsSelected).ToList().ForEach(s =>
                {
                    var shipment                 = orderRepository.Shipments.Where(o => o.ShipmentId == s.ShipmentId).First();
                    shipment.PicklistId          = null;
                    shipment.FulfillmentCenterId = null;
                    shipment.Status              = Foundation.Orders.Model.ShipmentStatus.Released.ToString();
                    var temp = Shipments.First(x => x.ShipmentId == shipment.ShipmentId);
                    Shipments.Remove(temp);
                    orderRepository.UnitOfWork.Commit();
                    InnerItem.Shipments.Remove(shipment);
                });
            }

            OnPropertyChanged("InnerItem");
            ReloadShipments();
            RemoveSelectedShipmentsCommand.RaiseCanExecuteChanged();
        }