/// <summary> /// Insert Into the orderline table and Update the Inventories in the products tables /// </summary> public void seedOrderLines_UpdateInventory() { string[] parse; string _productID_inventory = ""; string newInventory = ""; for (int i = 0; i < ProductNameListbox.Items.Count; i++) { _productID_inventory = select.GetProductID(api, ProductNameListbox.Items[i].ToString()); parse = _productID_inventory.Split(' '); insert.AddNewOrderLine(api, PoS.OrderID, parse[0], QuantityListbox.Items[i].ToString()); newInventory = calculateNewInventory(parse[1], QuantityListbox.Items[i].ToString()); update.updateProductInventory(api, parse[0], newInventory); } }