Example #1
0
        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);
        }
Example #2
0
        public string ToHtml(CourseType courseType)
        {
            var table1 = EmbadedResources.GetEmbeddedResource("Mashkanta.Reports.Table1.html");

            table1 = table1.Replace("@@TITLE@@", Course.GetCourseTitle(courseType));
            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 result = $"{table1}\r\n{Payments.ToHtml(courseType)}\r\n<hr />";

            return(result);
        }