public void updateStock(int stickId) { Selectedinventory = inventoryServices.GetItemByLocIdStickId(selectedLoc, stickId); Console.WriteLine("How much of this item would you like to add to the inventory?"); int toAdd = Int32.Parse(Console.ReadLine()); Selectedinventory.quantity = toAdd + Selectedinventory.quantity; inventoryServices.UpdateInventory(Selectedinventory); Console.WriteLine("The stock of this item has been updated!"); }
public IActionResult UpdateInventory(Inventory inventory) { try { _inventoryServices.UpdateInventory(inventory); return(CreatedAtAction("UpdateInventory", inventory)); } catch (Exception) { return(BadRequest()); } }