This commit is contained in:
thermalthrottle committed 2021-03-20 22:01:21 +02:00
commit df56840812
4 files changed
+126 -55

No files matched your search

@@ -390,22 +390,15 @@ namespace Business.Business.Sales
public void RemoveAmount(int productId, double Amount)
{
if (currentUser.RoleId > 1)
var product = Get(productId);
if (product != null)
{
var product = Get(productId);
if (product != null)
{
product.AmountInStock -= Amount;
context.SaveChanges();
}
else
{
throw new ArgumentException("Product id not valid!");
}
product.AmountInStock -= Amount;
context.SaveChanges();
}
else
{
throw new ArgumentException("Insufficient Role!");
throw new ArgumentException("Product id not valid!");
}
}