public PortfolioPageViewModel GetPortfolioPageViewModel(int clientId) { var equityTransactions = _portfolioRepository.GetEquityTransactions(clientId); var client = _portfolioRepository.GetClientById(clientId); var transactionGroups = equityTransactions.GetTransactionByTicker(); var plReport = _profitLossReportBuilder.GetProfitLossReport(transactionGroups); var last10DaysNetWorth = _netWorthReportBuilder.GetNetWorthHistory(transactionGroups); var summary = GetSummary(plReport); var tickerContribution = GetTickerContribution(plReport); var orderedTransaction = equityTransactions.GetOrderedTransaction(); var viewModel = new PortfolioPageViewModel { Client = client, Summary = summary, ProfitLosses = plReport, EquityTransactions = orderedTransaction, Last10DaysNetWorth = last10DaysNetWorth, TickerContribution = tickerContribution }; return(viewModel); }
public ActionResult Index(PortfolioPage currentPage) { var model = new PortfolioPageViewModel(currentPage) { SkillList = _skillHandler.LoadSkills(currentPage.SkillFolder), HasSkillPublishAccess = _skillHandler.CurrentUserHasSkillPublishAccess(currentPage.SkillFolder), SkillFolderIsSet = _skillHandler.SkillFolderIsSet(currentPage.SkillFolder), HeaderPart = _headerHandler.LoadHeader(currentPage.HeaderFolder), HasHeaderPublishAccess = _headerHandler.CurrentUserHasHeaderPublishAccess(currentPage.HeaderFolder), HeaderFolderIsSet = _headerHandler.HeaderFolderIsSet(currentPage.HeaderFolder) }; return(View(model)); }