@@ -8,34 +8,51 @@ modified to suit your own requirements.
8
8
9
9
## Example
10
10
11
+ Instantiate an API client with a company name, username, and password:
12
+
11
13
``` C#
12
14
var client = new ApiClient (" test" , " username" , " password" );
13
15
var inventory_client = new InventoryClient (client );
14
- Inventory inventory ;
16
+ ```
15
17
16
- // Create inventory
17
- inventory = new Inventory ();
18
+ Create a new inventory item:
19
+
20
+ ``` C#
21
+ Inventory inventory = new Inventory ();
18
22
inventory .whse = " 00" ;
19
23
inventory .partNo = " TESTPART" ;
20
24
inventory .type = InventoryType .Normal ;
21
25
inventory .status = InventoryStatus .Active ;
22
26
inventory .description = " Test Inventory" ;
23
27
inventory = inventory_client .Create (inventory );
28
+ ```
29
+
30
+ List inventory matching the query "TEST":
24
31
25
- // List inventory matching the query "TEST"
32
+ ``` C#
26
33
foreach (var i in inventory_client .List (0 , 100 , " TEST" ))
27
34
{
28
- // i.id
35
+ Console . WriteLine ( i . partNo );
29
36
}
37
+ ```
30
38
31
- // Get inventory
39
+ Retreive an inventory item by ID:
40
+
41
+ ``` C#
32
42
inventory = inventory_client .Fetch (inventory .id );
43
+ ```
44
+
45
+ Update a field on an existing inventory item:
33
46
34
- // Update inventory
47
+ ``` C#
35
48
inventory .description = " New Description" ;
36
49
inventory_client .Update (inventory .id , inventory );
50
+ ```
37
51
38
- // Delete inventory
52
+ Delete an inventory item (if inventory is in use this will throw an
53
+ ` ApiException ` ):
54
+
55
+ ``` C#
39
56
inventory_client .Delete (inventory .id );
40
57
```
41
58
0 commit comments