private int GetCostForItems(StockKeepingUnit stockControlUnit, int numberOfUnits) { if (stockControlUnit.HasMultibuyOffer && numberOfUnits > 1) { int cost = numberOfUnits / stockControlUnit.MultibuyUnitsRequired * stockControlUnit.MultibuyPrice; cost += numberOfUnits % stockControlUnit.MultibuyUnitsRequired * stockControlUnit.UnitPrice; return cost; } return stockControlUnit.UnitPrice * numberOfUnits; }
public void Scan(string sku) { StockKeepingUnit stockControlUnit = stockControl.GetStockControlUnit(sku); if (basket.ContainsKey(stockControlUnit)) { basket[stockControlUnit]++; } else { basket.Add(stockControlUnit, 1); } }