private void AddBody(ReportPage template) { template.Replace("date", _date.ToString("dd/MM/yyyy")); template.Replace("InvestorName", _investor.Name); template.Replace("InvestorNumber", _investor.Number); template.Replace("recommendation", template.GetRecommendation(ResultsProvider.ShouldBuy(_results))); template.Replace("stake", ResultsProvider.Stake(_results).ToString("C2")); template.Replace("profit", ResultsProvider.TotalProfit(_results).ToString("C2")); template.Replace("marketAverage", _resultsProvider.MarketAverage().ToString("C2")); }
private void AddResultsSummary(ReportPage template) { var summary = new StringBuilder(); foreach (var s in _results) { summary.Append("<tr>"); summary.Append($"<td>{s.StrategyType}</td>"); summary.Append($"<td>{template.GetRecommendation(s.ShouldBuy)}</td>"); summary.Append($"<td>{s.ProfitYTD:C2}</td>"); summary.Append($"<td>{s.ProfitTotal:C2}</td>"); summary.Append($"<td>{s.BuyCount}</td>"); summary.Append("</tr>"); } template.Replace("results", summary.ToString()); }