public List <ShippingBox> GetShippingBoxes()
 {
     using (var soapClient = new ShipmentSoapClient(_settings))
     {
         return(soapClient.GetShipmentBoxes());
     }
 }
        private ShipmentMapper GetShipment(string shipmentId)
        {
            Shipment shipment;

            using (var soapClient = new ShipmentSoapClient(_settings))
            {
                shipment = soapClient.GetShipmentByShipmentId(shipmentId);
            }

            return(new ShipmentMapper().MapShipment(shipment));
        }
        public void UpdateShipments(List <Shipment> shipments, ISmartShipmentExportContext smartShipmentExportContext, ref string currentProcessedShipmentNumber)
        {
            using (var soapClient = new ShipmentSoapClient(_settings))
            {
                foreach (var shipment in shipments.ToList())
                {
                    currentProcessedShipmentNumber = shipment.ShipmentNbr.Value;
                    var targetShipment = soapClient.GetShipmentByShipmentId(shipment.ShipmentNbr.Value);
                    smartShipmentExportContext.MapTargetToExportedShipment(targetShipment, shipment);
                    soapClient.UpdateShipment(targetShipment, _messagesProvider);
                }
            }

            if (shipments.Any() && shipments.Last() != null)
            {
                _browserHelper.ReloadActiveBrowserPage(shipments.Last().ShipmentNbr.Value);
            }

            var shipmentsNumbers = shipments.Select(s => s.ShipmentNbr.Value);

            _messagesProvider.Log(string.Format(InformationResources.INFO_SUCCESS_UPDATE_SHIPMENT, shipments.Count, string.Join(", ", shipmentsNumbers)));
        }