Merge branch 'react-version' of https://github.com/MarcEricMartel/420-5DW-HY-TP into react-version
This commit is contained in:
commit
565f677c38
@ -159,6 +159,12 @@ public class InvoiceController : Controller {
|
|||||||
return BadRequest();
|
return BadRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (prods.Count == 0)
|
||||||
|
return BadRequest("Vous devez inclure au moins un produit à votre commande.");
|
||||||
|
|
||||||
|
inv.Products = new();
|
||||||
|
|
||||||
foreach (var prod in prods) {
|
foreach (var prod in prods) {
|
||||||
inv.Products.Add(new() {
|
inv.Products.Add(new() {
|
||||||
Product = prod,
|
Product = prod,
|
||||||
@ -166,9 +172,6 @@ public class InvoiceController : Controller {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prods.Count == 0)
|
|
||||||
return BadRequest("Vous devez inclure au moins un produit à votre commande.");
|
|
||||||
|
|
||||||
foreach (var prod in sinv.ProdQuant) { // Update de quantités dans l'inventaire.
|
foreach (var prod in sinv.ProdQuant) { // Update de quantités dans l'inventaire.
|
||||||
ProductModel inventProd = prods.Where(x => x.Id == prod.Key).First();
|
ProductModel inventProd = prods.Where(x => x.Id == prod.Key).First();
|
||||||
if (inventProd.Quantity < prod.Value)
|
if (inventProd.Quantity < prod.Value)
|
||||||
|
Loading…
Reference in New Issue
Block a user