public int NumberOfSharesOfStockInPortfolio(string inPortfolioID, string inStockName) { Portfolio portfolio = this.getPortfolioFromStockExchange(inPortfolioID); string unifiedName = unifyName(inStockName); return(portfolio.NumberOfSharesOfStockInPortfolio(unifiedName)); }
public void RemoveStockFromPortfolio(string inPortfolioID, string inStockName) { Portfolio portfolio = this.getPortfolioFromStockExchange(inPortfolioID); string unifiedName = unifyName(inStockName); int stocksToRemove = portfolio.NumberOfSharesOfStockInPortfolio(unifiedName); portfolio.RemoveStockFromPortfolio(unifiedName); this.soldStocks [unifiedName] += stocksToRemove; }