Exemple #1
0
        public Models.Products.ProductPriceUpdateResponse PriceUpdate(Models.Products.ProductPriceUpdateRequest request)
        {
            if (request.Products == null || request.Products.Length == 0)
            {
                return new Models.Products.ProductPriceUpdateResponse {
                           Error = "Products not supplied"
                }
            }
            ;

            var user = Models.User.UserConfig.Load(request.AuthorizationToken);

            if (user == null)
            {
                return new Models.Products.ProductPriceUpdateResponse {
                           Error = "User not found"
                }
            }
            ;


            var response = new Models.Products.ProductPriceUpdateResponse();

            foreach (var product in request.Products)
            {
                if (product.SKU == "MyNonExistantSKU")
                {
                    response.Products.Add(new Models.Products.ProductPriceResponse {
                        SKU = product.SKU, Error = "SKU does not exist"
                    });
                }
            }
            return(response);
        }
    }
}
        public Models.Products.ProductPriceUpdateResponse PriceUpdate(Models.Products.ProductPriceUpdateRequest request)
        {
            if (request.Products == null || request.Products.Length == 0)
                return new Models.Products.ProductPriceUpdateResponse { Error = "Products not supplied" };

            var user = Models.User.UserConfig.Load(request.AuthorizationToken);

            if (user == null)
                return new Models.Products.ProductPriceUpdateResponse { Error = "User not found" };


            var response = new Models.Products.ProductPriceUpdateResponse();

            foreach (var product in request.Products)
            {
                if (product.SKU == "MyNonExistantSKU")
                {
                    response.Products.Add(new Models.Products.ProductPriceError { SKU = product.SKU, Error = "SKU does not exist" });
                }
            }
            return response;
        }