public Category Save(Category category, Enums.CategoryType categoryType) { if (categoryType == Enums.CategoryType.Account) { throw new NotSupportedException("Account Category Save is not supported by the API."); } var url = string.Format("{0}Category/Save?apikey={1}&companyid={2}", categoryType, _apiKey, _companyId); var request = new RestRequest(url, Method.POST) { JsonSerializer = new JsonSerializer() }; request.RequestFormat = DataFormat.Json; request.AddBody(category); var response = _client.Execute<Category>(request); return response.Data; }
public void Save_SupplierCategory() { var category = new Category(); category.Description = "Supplier Category - Test"; var newCategory = Api.CategoryRequest.Save(category, Enums.CategoryType.Supplier); }
public void Save_ItemCategory() { var itemCategory = new Category(); itemCategory.Description = "Accessories"; var newCategory = Api.CategoryRequest.Save(itemCategory, Enums.CategoryType.Item); }
public void Save_CustomerCategory() { var itemCategory = new Category(); itemCategory.Description = "Customer Category Test"; var newCategory = Api.CategoryRequest.Save(itemCategory, Enums.CategoryType.Customer); }
public void Save_BankAccountCategory() { var itemCategory = new Category(); itemCategory.Description = "BankAccount Category Test"; var newCategory = Api.CategoryRequest.Save(itemCategory, Enums.CategoryType.BankAccount); }
public void Save_AssetCategory() { var itemCategory = new Category(); itemCategory.Description = "Asset Category Test"; var newCategory = Api.CategoryRequest.Save(itemCategory, Enums.CategoryType.Asset); }