Пример #1
0
 public IActionResult AddProductToLocation(InventoryModel inventory)
 {
     try
     {
         ProductModel newItem = new ProductModel();
         newItem = _productService.GetProductByID(inventory.productID);
         InventoryModel iitem = new InventoryModel()
         {
             productID  = newItem.ID,
             locationID = inventory.locationID,
             Quantity   = inventory.Quantity
         };
         _inventoryService.AddProductToLocation(iitem);
         return(CreatedAtAction("AddProductToLocation", inventory));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }