示例#1
0
        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!");
        }
示例#2
0
 public IActionResult UpdateInventory(Inventory inventory)
 {
     try
     {
         _inventoryServices.UpdateInventory(inventory);
         return(CreatedAtAction("UpdateInventory", inventory));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }