Example #1
0
        private async void LoadData()
        {
            try
            {
                isLoaded = false;
                isBusy   = true;

                TrackingList.Clear();
                responseObject = await trackingService.GetTrackingData(requestObject.JobType, requestObject.JobId);

                if (responseObject.ReturnCode == "ERR_SUCCESS")
                {
                    foreach (Tracking a in responseObject.TrackingInfoList)
                    {
                        TrackingList.Add(new TrackingModelView(a));
                    }
                }
                else
                {
                    //Error
                }
            }
            catch (Exception e)
            {
                //Exception
            }
            finally
            {
                isLoaded = true;
                isBusy   = false;
            }
        }
        public void TrackShipment()
        {
            ShipmentTrackingRequest trackingRequest = CreateTrackingRequest("0405510200882103615281");

            VisibleRequest           visibleRequest   = new VisibleRequest(trackingRequest, "Shipment/Track");
            ShipmentTrackingResponse trackingResponse = visibleRequest.Execute <ShipmentTrackingResponse>();

            Assert.AreEqual(0, trackingResponse.ResultCode);
        }
        public void CreateAndTrackShipment()
        {
            // Create label
            LabelRequest   labelRequest   = CreateLabelRequest();
            VisibleRequest visibleRequest = new VisibleRequest(labelRequest, "Label/Create");
            LabelResponse  labelResponse  = visibleRequest.Execute <LabelResponse>();

            Assert.AreEqual(0, labelResponse.ResultCode);

            // Track Shipment
            ShipmentTrackingRequest trackingRequest = CreateTrackingRequest(labelResponse.TrackingNumber);

            visibleRequest = new VisibleRequest(trackingRequest, "Shipment/Track");
            ShipmentTrackingResponse trackingResponse = visibleRequest.Execute <ShipmentTrackingResponse>();

            Assert.AreEqual(0, trackingResponse.ResultCode);
        }