public void getAllArticles() { ShopwareApi shopwareApi = ApiConnection.getDemoApi(); List <ArticleMain> articles = shopwareApi.getArticleRessource().getAll(); Console.WriteLine("Found articles: " + articles.Count); }
public static ShopwareApi getDemoApi() { // URL, USERNAME, API-KEY ShopwareApi shopwareApi = new ShopwareApi("", "", ""); return(shopwareApi); }
public void getArticleByOrdernumber() { ShopwareApi shopwareApi = ApiConnection.getDemoApi(); ArticleMain article = shopwareApi.getArticleRessource().getByOrdernumber("SW10151"); Console.WriteLine("Artikel: " + article.name); Console.WriteLine("- ID: " + article.id); }
public void getArticleById() { ShopwareApi shopwareApi = ApiConnection.getDemoApi(); ArticleMain article = shopwareApi.getArticleRessource().get(1); Console.WriteLine("Artikel: " + article.name); Console.WriteLine("- ID: " + article.id); }
public void update() { ShopwareApi shopwareApi = ApiConnection.getDemoApi(); Category category = shopwareApi.getCategoryRessource().get(8); category.name = "Kategorie 8"; shopwareApi.getCategoryRessource().update(category); }
public void add() { ShopwareApi shopwareApi = ApiConnection.getDemoApi(); Category category = new Category(); category.name = "Test"; category.parentId = 3; category.active = true; shopwareApi.getCategoryRessource().add(category); }
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); } }
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); }
public void delete() { ShopwareApi shopwareApi = ApiConnection.getDemoApi(); shopwareApi.getCategoryRessource().delete(6); }