public string ToHtml() { var report = EmbadedResources.GetEmbeddedResource("Mashkanta.Reports.Report.html"); var table1 = EmbadedResources.GetEmbeddedResource("Mashkanta.Reports.Table1.html"); var courses = Courses.ToHtml(); var summery = Summery.ToHtml(); table1 = table1.Replace("@@TITLE@@", Course.GetCourseTitle(Course.CourseType.None)); table1 = table1.Replace("@@RATIO@@", Ratio.ToString("N2")); table1 = table1.Replace("@@MIN_PAYMENT@@", MinMonthReturn.ToString("N2")); table1 = table1.Replace("@@MAX_PAYMENT@@", MaxMonthReturn.ToString("N2")); table1 = table1.Replace("@@TOTAL_PAYMENT@@", TotalReturn.ToString("N2")); table1 = table1.Replace("@@INTEREST@@", TotalInterestAndPriceIndex.ToString("N2")); var tableAll = table1 + TotalPayments.ToHtml(Course.CourseType.None); report = report.Replace("@@COURSES@@", courses); report = report.Replace("@@SUMMERY@@", summery); report = report.Replace("@@TABLE_ALL@@", tableAll); report = report.Replace("@@PaymentDoughnutChart@@", new PaymentDoughnut(this, "PaymentDoughnutChart").ToHtml()); var tableCources = string.Empty; foreach (var c in Courses) { tableCources += c.Result.ToHtml(c.Type); } report = report.Replace("@@TABLE_COURSE@@", tableCources); return(report); }
public string ToHtml() { var report = EmbadedResources.GetEmbeddedResource("Mashkanta.Reports.Table2.html"); var rows = string.Join("\r\n", this.Select(t => t.ToHtml())); var result = report.Replace("@@Table2Rows@@", rows); return(result); }
public string ToHtml() { var template = EmbadedResources.GetEmbeddedResource("Mashkanta.Reports.Table2Row.html"); var result = template.Replace("@@Year@@", Year.ToString()); result = result.Replace("@@TotalPayment@@", TotalPayment.ToString("N0")); result = result.Replace("@@AveragePayment@@", AveragePayment.ToString("N0")); return(result); }
public string ToHtml() { var table = EmbadedResources.GetEmbeddedResource("Mashkanta.Reports.TableCourse.html"); var rows = this.Select(r => r.ToHtml()).ToList(); var rowsHtml = string.Join("\r\n", rows); table = table.Replace("@@TableCourseRows@@", rowsHtml); return(table); }
public string ToHtml() { var row = EmbadedResources.GetEmbeddedResource("Mashkanta.Reports.PaymentDoughnut.html"); var labels = new List <string> { $"ריבית ({_mix.TotalInterest:N0} ₪)", $"הצמדה ({_mix.TotalPriceIndex:N0} ₪)", $"קרן ({_mix.TotalLoan:N0}) ₪" }; var data = new List <int> { Convert.ToInt32(_mix.TotalInterest), Convert.ToInt32(_mix.TotalPriceIndex), Convert.ToInt32(_mix.TotalLoan) }; var color = new List <string> { "rgba(255,99,132,1)", "rgba(255, 206, 86, 1)", "rgba(54, 162, 235, 1)" }; row = row.Replace("@@NAME@@", _name); row = row.Replace("@@LABELS@@", string.Join(",", labels.Select(l => $"'{l}'"))); row = row.Replace("@@DATA@@", string.Join(",", data)); row = row.Replace("@@COLORS@@", string.Join(",", color.Select(l => $"'{l}'"))); return(row); }