Пример #1
0
        /// <summary>
        /// Get trackings from your account with the ParametersTracking defined in the params.
        /// </summary>
        /// <param name="parameters">ParametersTracking Object, with the information to get.</param>
        /// <returns>A List of Tracking Objects from your account.</returns>
        public IList <Tracking> GetTrackings(ParametersTracking parameters)
        {
            IList <Tracking> trackingList = null;
            var response     = Request("GET", string.Format("/trackings?{0}", parameters.GenerateQueryString()), null);
            var trackingJson = (JArray)response["data"]["trackings"];

            if (trackingJson.Count != 0)
            {
                var size = (int)response["data"]["count"];
                trackingList = new List <Tracking>();
                foreach (var token in trackingJson)
                {
                    trackingList.Add(new Tracking((JObject)token));
                }

                parameters.Total = size;
            }

            return(trackingList);
        }
Пример #2
0
 /// <summary>
 /// Get next page of Trackings from your account with the ParametersTracking defined in the params.
 /// </summary>
 /// <param name="parameters">ParametersTracking Object, with the information to get.</param>
 /// <returns> The next page of Tracking Objects from your account.</returns>
 public IList <Tracking> GetTrackingsNext(ParametersTracking parameters)
 {
     parameters.Page = parameters.Page + 1;
     return(GetTrackings(parameters));
 }