Ejemplo n.º 1
0
		public async Task<Product[]> Search(string barcode, BarcodeType barcodeType)
		{
			var searchCriteria = new SearchCriteria
			{
				Operation = "ItemLookup",
				SearchIndex = "Grocery",
				ResponseGroups = new[] { "Images", "ItemAttributes" },
				IdType = barcodeType.ToString(),
				ItemId = barcode
			};

			var items = await _client.GetItems(searchCriteria);
			return items.Select(i => _factory.Create(i, searchCriteria)).ToArray();
		}
Ejemplo n.º 2
0
        public async Task <ReadBarcodesRes> ReadBarcodesByTypeAsync(byte[] file, BarcodeType barcodeType)
        {
            byte[] res = await CustomHttp.postWrapper(
                new List <string> {
                "barcodeType", barcodeType.ToString()
            },
                new List <Tuple <byte[], string, string> > {
                new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
            },
                "Barcode/ReadBarcodesByType",
                _httpClient);

            // desirialization
            string respJson = System.Text.Encoding.Default.GetString(res);

            return(JsonConvert.DeserializeObject <ReadBarcodesRes>(respJson));
        }