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); }
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 IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { if (DatePayment == null) { yield return(new ValidationResult("Tanggal harus di isi!", new List <string> { "DatePayment" })); } if (Bank == null || Bank.BankName.ToString() == "") { yield return(new ValidationResult("Bank Tujuan harus di isi!", new List <string> { "Bank" })); } if (Buyer == null || Buyer.Id.GetValueOrDefault() <= 0) { yield return(new ValidationResult("Buyer harus di isi!", new List <string> { "Buyer" })); } if (TotalPayment.GetValueOrDefault() <= 0) { yield return(new ValidationResult("Jumlah yang dibayarkan harus di isi!", new List <string> { "TotalPayment" })); } if (Currency == null || Currency.Id.GetValueOrDefault() <= 0) { yield return(new ValidationResult("Kurs harus di isi!", new List <string> { "Currency" })); } if (string.IsNullOrWhiteSpace(CategoryAcceptance)) { yield return(new ValidationResult("Kategori Bukti Penerimaan harus di isi!", new List <string> { "CategoryAcceptance" })); } if (string.IsNullOrWhiteSpace(Remark)) { yield return(new ValidationResult("Untuk Pembayaran harus di isi!", new List <string> { "Remark" })); } }