Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

Commit 3614450

Browse files
committed
Update README
1 parent 4375835 commit 3614450

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,51 @@ modified to suit your own requirements.
88

99
## Example
1010

11+
Instantiate an API client with a company name, username, and password:
12+
1113
```C#
1214
var client = new ApiClient("test", "username", "password");
1315
var inventory_client = new InventoryClient(client);
14-
Inventory inventory;
16+
```
1517

16-
// Create inventory
17-
inventory = new Inventory();
18+
Create a new inventory item:
19+
20+
```C#
21+
Inventory inventory = new Inventory();
1822
inventory.whse = "00";
1923
inventory.partNo = "TESTPART";
2024
inventory.type = InventoryType.Normal;
2125
inventory.status = InventoryStatus.Active;
2226
inventory.description = "Test Inventory";
2327
inventory = inventory_client.Create(inventory);
28+
```
29+
30+
List inventory matching the query "TEST":
2431

25-
// List inventory matching the query "TEST"
32+
```C#
2633
foreach (var i in inventory_client.List(0, 100, "TEST"))
2734
{
28-
// i.id
35+
Console.WriteLine(i.partNo);
2936
}
37+
```
3038

31-
// Get inventory
39+
Retreive an inventory item by ID:
40+
41+
```C#
3242
inventory = inventory_client.Fetch(inventory.id);
43+
```
44+
45+
Update a field on an existing inventory item:
3346

34-
// Update inventory
47+
```C#
3548
inventory.description = "New Description";
3649
inventory_client.Update(inventory.id, inventory);
50+
```
3751

38-
// Delete inventory
52+
Delete an inventory item (if inventory is in use this will throw an
53+
`ApiException`):
54+
55+
```C#
3956
inventory_client.Delete(inventory.id);
4057
```
4158

0 commit comments

Comments
 (0)