public bool IsProductInStock(Guid costCentreId, Guid productId, decimal prodQtytyAddedToLineItems, decimal prodQtyToAdd, out decimal invBalance) { bool retVal = false; decimal invBal = 0m; using (var c = ObjectFactory.Container.GetNestedContainer()) { _inventoryService = c.GetInstance<IInventoryRepository>(); var prodInv = _inventoryService.GetByProductIdAndWarehouseId(productId, costCentreId); if (prodInv != null) { invBal = prodInv.Balance; if ((invBal - prodQtytyAddedToLineItems) > 0) retVal = true; } invBalance = invBal; } return retVal; }