Views fixes
This commit is contained in:
1 parent
027c1c9b0f
commit
df8b814e65
4 files changed
+126
-55
No files matched your search
@@ -359,22 +359,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!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user