P1_TrevorGraham/MvcStoreApplication/BusinessLogic/BusinessLogic.cs
/// <summary>
/// returns whether or not the given quantity is greater than the given inventory viewmodel based on the db
/// </summary>
/// <param name="quantity"></param>
/// <param name="inventoryViewModel"></param>
/// <returns></returns>
returns whether or not the given quantity is greater than the given inventory viewmodel based on the db
returns whether or not the given quantity is greater than the given inventory viewmodel based on the db
public bool AmountIsGreaterThanInventory(int quantity, InventoryViewModel inventoryViewModel)
        {
            if (inventoryViewModel != null)
            {
                var dbInv = _repository.GetInventoryById(inventoryViewModel.InventoryId);
                if (dbInv != null)
                {
                    if (quantity < dbInv.Quantity)
                    {
                        return false;
                    }
                }
            }
            return true;
        }
public bool AmountIsGreaterThanInventory ( int quantity , InventoryViewModel inventoryViewModel ) { if ( inventoryViewModel != null ) { var dbInv = _repository . GetInventoryById ( inventoryViewModel . InventoryId ) ; if ( dbInv != null ) { if ( quantity < dbInv . Quantity ) { return false ; } } } return true ; }
returns whether or not the given quantity is greater than the given inventory viewmodel based on the db
returns whether or not the given quantity is greater than the given inventory viewmodel based on the db
None
quantity
int
None
inventoryViewModel
InventoryViewModel
None