Ejemplo n.º 1
0
        public void getAllArticles()
        {
            ShopwareApi        shopwareApi = ApiConnection.getDemoApi();
            List <ArticleMain> articles    = shopwareApi.getArticleRessource().getAll();

            Console.WriteLine("Found articles: " + articles.Count);
        }
Ejemplo n.º 2
0
        public static ShopwareApi getDemoApi()
        {
            // URL, USERNAME, API-KEY
            ShopwareApi shopwareApi = new ShopwareApi("", "", "");

            return(shopwareApi);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
        public void update()
        {
            ShopwareApi shopwareApi = ApiConnection.getDemoApi();

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

            category.name = "Kategorie 8";

            shopwareApi.getCategoryRessource().update(category);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
        public void delete()
        {
            ShopwareApi shopwareApi = ApiConnection.getDemoApi();

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