コード例 #1
0
        public void getAllArticles()
        {
            ShopwareApi        shopwareApi = ApiConnection.getDemoApi();
            List <ArticleMain> articles    = shopwareApi.getArticleRessource().getAll();

            Console.WriteLine("Found articles: " + articles.Count);
        }
コード例 #2
0
        public static ShopwareApi getDemoApi()
        {
            // URL, USERNAME, API-KEY
            ShopwareApi shopwareApi = new ShopwareApi("", "", "");

            return(shopwareApi);
        }
コード例 #3
0
        public void getArticleByOrdernumber()
        {
            ShopwareApi shopwareApi = ApiConnection.getDemoApi();
            ArticleMain article     = shopwareApi.getArticleRessource().getByOrdernumber("SW10151");

            Console.WriteLine("Artikel: " + article.name);
            Console.WriteLine("- ID: " + article.id);
        }
コード例 #4
0
        public void getArticleById()
        {
            ShopwareApi shopwareApi = ApiConnection.getDemoApi();
            ArticleMain article     = shopwareApi.getArticleRessource().get(1);

            Console.WriteLine("Artikel: " + article.name);
            Console.WriteLine("- ID: " + article.id);
        }
コード例 #5
0
        public void update()
        {
            ShopwareApi shopwareApi = ApiConnection.getDemoApi();

            Category category = shopwareApi.getCategoryRessource().get(8);

            category.name = "Kategorie 8";

            shopwareApi.getCategoryRessource().update(category);
        }
コード例 #6
0
        public void add()
        {
            ShopwareApi shopwareApi = ApiConnection.getDemoApi();

            Category category = new Category();

            category.name     = "Test";
            category.parentId = 3;
            category.active   = true;

            shopwareApi.getCategoryRessource().add(category);
        }
コード例 #7
0
        public void get()
        {
            ShopwareApi shopwareApi = ApiConnection.getDemoApi();

            try
            {
                Category category = shopwareApi.getCategoryRessource().get(5);
                Debug.WriteLine("Found category with name: " + category.name);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
                Debug.WriteLine(e.StackTrace);
            }
        }
コード例 #8
0
        public void getAll()
        {
            ShopwareApi     shopwareApi = ApiConnection.getDemoApi();
            List <Category> categories  = shopwareApi.getCategoryRessource().getAll();

            Debug.WriteLine("Found: " + categories.Count);

            int categoryID = 0;

            foreach (Category category in categories)
            {
                if (category.name == "Deutsch")
                {
                    categoryID = (int)category.id;
                }
            }

            Debug.WriteLine("CategoryID: " + categoryID);
        }
コード例 #9
0
        public void delete()
        {
            ShopwareApi shopwareApi = ApiConnection.getDemoApi();

            shopwareApi.getCategoryRessource().delete(6);
        }