From 3ed1eed02dddbd294256063794cfd07ac24b524d Mon Sep 17 00:00:00 2001 From: "DESKTOP-2S5P7D1\\Windows 10" Date: Mon, 4 Sep 2023 17:00:37 +0700 Subject: [PATCH] format year to thai --- .../Repositories/Reports/InsigniaReportRepository.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs index 98ba6fc7..cefd7326 100644 --- a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs @@ -42,10 +42,20 @@ namespace BMA.EHR.Application.Repositories.Reports .FirstOrDefaultAsync(x => x.Id == id); if (period == null) throw new Exception(GlobalMessages.InsigniaPeriodNotFound); - string thaiYear = period.Year.ToThaiYear().ToString(); + string thaiYear = period.Year.ToThaiYear().ToString().ToThaiNumber(); return thaiYear; } + public async Task Get2YearInsigniaPeriod(Guid id) + { + var period = await _dbContext.Set() + .FirstOrDefaultAsync(x => x.Id == id); + if (period == null) + throw new Exception(GlobalMessages.InsigniaPeriodNotFound); + string thaiYear = period.Year.ToThaiYear().ToString().ToThaiNumber(); + return thaiYear.Substring(2); + } + public async Task GetKhr1Report(Guid id) { var period = await _dbContext.Set()