コード例 #1
0
        public string ToHtml(CourseType courseType)
        {
            const string cellTemplate = "<div class=\"cell\">{0}</div>\r\n";
            var          cellsContent = string.Format(cellTemplate, Period);

            cellsContent += string.Format(cellTemplate, PeriodDate.ToString("MM/yyyy"));
            if (courseType != CourseType.None)
            {
                cellsContent += string.Format(cellTemplate, InterestMonthPercentage.ToString("N4") + "%");
                cellsContent += string.Format(cellTemplate, InterestYearPercentage.ToString("N2") + "%");
            }

            cellsContent += string.Format(cellTemplate, InterestPayment.ToString("N0"));
            cellsContent += string.Format(cellTemplate, FundPayment.ToString("N0"));
            if (PriceIndexCourses.Contains(courseType))
            {
                cellsContent += string.Format(cellTemplate, FundPaymentWithPriceIndex.ToString("N0"));
            }

            cellsContent += string.Format(cellTemplate, TotalFund.ToString("N0"));
            if (PriceIndexCourses.Contains(courseType))
            {
                cellsContent += string.Format(cellTemplate, TotalFundWithPriceIndex.ToString("N0"));
            }

            var paymentTemplate = cellTemplate.Replace("class=\"cell\"", "class=\"cell payment_green\"");

            cellsContent += string.Format(paymentTemplate, "₪" + TotalPayment.ToString("N0"));
            var result = $"<div class=\"row\">\r\n{cellsContent.Trim()}\r\n</div>\r\n";

            return(result);
        }
コード例 #2
0
ファイル: Summery.cs プロジェクト: atias007/Mashkanta
        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);
        }