コード例 #1
0
        public CoopStoreApi CoopCloseStore()
        {
            //BearerAccessToken bearerAccessToken = new BearerAccessToken("f0cabde6bb8d4bd78c28270ee203253f"); /* Code #1 */
            //BearerAccessToken bearerAccessToken = new BearerAccessToken("d0b9a5266a2749cda99d4468319b6d9f"); /* Code #2 */

            BearerAccessToken bearerAccessToken = new BearerAccessToken(token);

            // Create link to a store with radius as input
            string url = linkMaker.GetRadiusLink(radius, geo);

            // Open the link using the url and token
            OpenHttp <CoopStoreApi> openHttp = new OpenHttp <CoopStoreApi>(url, bearerAccessToken.GetBearerToken());

            // Parse
            CoopStoreApi stuff = openHttp.ReadAndParseAPISingle();

            // Create list for StoreId in the different stores found inside the radius
            List <int> storId = new List <int>();

            // Fill the StoreId list with Kardex (storeid) for the different stores
            //foreach (var product in stuff.Data)
            //{
            //    storId.Add(product.Kardex);
            //}

            //foreach (var store in stuff.Data)
            //{
            //    Console.WriteLine(store.RetailGroupName + " - " + store.Kardex + " - " + store.Address + " - " + store.Zipcode);
            //}

            return(stuff);
        }
コード例 #2
0
        public List <CoopProduct> CoopFindEverythingInStore(string storeId)
        {
            BearerAccessToken      bearerAccessToken = new BearerAccessToken(token);
            OpenHttp <CoopProduct> openHttpStore     = new OpenHttp <CoopProduct>(bearerAccessToken.GetBearerToken());

            string url = linkMaker.GetProductLinke(storeId);

            openHttpStore.ChangeUrl(url);

            List <CoopProduct> coopProducts = openHttpStore.ReadAndParseAPI();

            //foreach(var item in coopProducts)
            //{
            //    Console.WriteLine(item.Navn + " - " + item.Pris);
            //}

            return(coopProducts);
        }