Beispiel #1
0
        /// <summary>
        /// Запрос данных о заказах в партии
        /// </summary>
        /// <param name="BatchName">Имя партии</param>
        /// <returns></returns>
        public FindOrderResult[] GetOrdersInBatch(string BatchName)
        {
            string url = $"{this._BaseUrl}/1.0/batch/{BatchName}/shipment";

            string requestResult =
                (Task.Run(async()
                          => await AsyncGET(url)))
                .Result;
            var result = FindOrderResult.FromJson(requestResult);

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Поиск заказов по ШПИ
        /// </summary>
        /// <param name="Barcode">Штрихкод(ШПИ)</param>
        /// <returns>Массив FindOrderResult</returns>
        public FindOrderResult[] GetOrderByBarcode(string Barcode)
        {
            if (string.IsNullOrWhiteSpace(Barcode))
            {
                throw new NullReferenceException("string Barcode is NullOrEmpty");
            }

            string url = $"{this._BaseUrl}/1.0/shipment/search?query={Barcode}";

            string requestResult =
                (Task.Run(async()
                          => await AsyncGET(url)))
                .Result;
            var result = FindOrderResult.FromJson(requestResult);

            return(result);
        }