diff --git a/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs b/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs index 4353f6f6..7655e052 100644 --- a/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs +++ b/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs @@ -8952,6 +8952,7 @@ namespace BMA.EHR.Application.Repositories MarkDiscipline = h.MarkDiscipline, MarkLeave = h.MarkLeave, MarkRate = h.MarkRate, + MarkInsignia = h.MarkInsignia, MatchingConditions = h.MatchingConditions == null || h.MatchingConditions == "" ? null : JsonConvert.DeserializeObject>(h.MatchingConditions) @@ -9111,7 +9112,7 @@ namespace BMA.EHR.Application.Repositories LastUpdatedAt = DateTime.Now, // Add Information for reused in API Call - ProfileType = item.ProfileType ?? "officer", + ProfileType = item.ProfileType != null && item.ProfileType != "" ? item.ProfileType.ToLower() : "officer", Prefix = item.Prefix, FirstName = item.FirstName, LastName = item.LastName, @@ -9221,7 +9222,7 @@ namespace BMA.EHR.Application.Repositories LastUpdatedAt = DateTime.Now, // Add Information for reused in API Call - ProfileType = item.ProfileType ?? "officer", + ProfileType = item.ProfileType != null && item.ProfileType != "" ? item.ProfileType.ToLower() : "officer", Prefix = item.Prefix, FirstName = item.FirstName, LastName = item.LastName, diff --git a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs index 5099b375..52600792 100644 --- a/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/InsigniaReportRepository.cs @@ -1590,11 +1590,11 @@ namespace BMA.EHR.Application.Repositories.Reports if (type == "officer") { - data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToUpper() == "OFFICER"); + data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "officer"); } else if (type == "employee") { - data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToUpper() == "EMPLOYEE"); + data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "employee"); } switch (node) @@ -1663,11 +1663,11 @@ namespace BMA.EHR.Application.Repositories.Reports if (type == "officer") { - data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToUpper() == "OFFICER"); + data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "officer"); } else if (type == "employee") { - data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToUpper() == "EMPLOYEE"); + data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "employee"); } switch (node) @@ -1736,11 +1736,11 @@ namespace BMA.EHR.Application.Repositories.Reports if (type == "officer") { - data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToUpper() == "OFFICER"); + data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "officer"); } else if (type == "employee") { - data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToUpper() == "EMPLOYEE"); + data_insigniaQuery = data_insigniaQuery.Where(r => r.ProfileType.Trim().ToLower() == "employee"); } switch (node) diff --git a/BMA.EHR.Application/Requests/InsigniaRequestItem.cs b/BMA.EHR.Application/Requests/InsigniaRequestItem.cs index c500bcc0..330626d9 100644 --- a/BMA.EHR.Application/Requests/InsigniaRequestItem.cs +++ b/BMA.EHR.Application/Requests/InsigniaRequestItem.cs @@ -23,6 +23,7 @@ public bool? MarkDiscipline { get; set; } public bool? MarkLeave { get; set; } public bool? MarkRate { get; set; } + public bool? MarkInsignia { get; set; } public List? Docs { get; set; } public List MatchingConditions { get; set; } = new List(); diff --git a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs index d60bb2ff..b9a7cf48 100644 --- a/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs +++ b/BMA.EHR.Insignia/Controllers/InsigniaRequestController.cs @@ -334,7 +334,7 @@ namespace BMA.EHR.Insignia.Service.Controllers // // บันทึกรายชื่อ // await _repository.InsertCandidate(period, ocId, candidate); //} - if (role.Trim().ToUpper() == "OFFICER") + if (role.Trim().ToLower() == "officer") { resend.Items = (await _repository.InsigniaHasProfile(result.PeriodId, ocId, status, type)) .Where(x => x.ProfileType!.ToLower() == type.ToLower()).ToList(); @@ -453,7 +453,7 @@ namespace BMA.EHR.Insignia.Service.Controllers // // บันทึกรายชื่อ // await _repository.InsertCandidate(period, ocId, candidate); //} - if (role.Trim().ToUpper() == "OFFICER") + if (role.Trim().ToLower() == "officer") { resend.Items = await _repository.InsigniaHasProfile(result.PeriodId, ocId, status); return Success(resend); @@ -549,7 +549,7 @@ namespace BMA.EHR.Insignia.Service.Controllers } } - var resultData = candidates.Where(x => x.ProfileType == "EMPLOYEE").ToList(); + var resultData = candidates.Where(x => x.ProfileType == "employee").ToList(); //var resultData = allEmployeeProfileByRoot.Select(x => new //{ @@ -1168,7 +1168,7 @@ namespace BMA.EHR.Insignia.Service.Controllers LastUpdateUserId = UserId ?? "", LastUpdatedAt = DateTime.Now, // Add Information for reused in API Call - ProfileType = profile.ProfileType ?? "officer", + ProfileType = profile.ProfileType != null && profile.ProfileType != "" ? profile.ProfileType.ToLower() : "officer", Prefix = profile.Prefix, FirstName = profile.FirstName, LastName = profile.LastName, @@ -2139,7 +2139,7 @@ namespace BMA.EHR.Insignia.Service.Controllers { insigniaNoteProfile.Status = "DONE"; - if (profile.ProfileType == "OFFICER") + if (profile.ProfileType == "officer") { var profileInsigniaBody = new PostProfileInsigniaDto { @@ -2207,7 +2207,7 @@ namespace BMA.EHR.Insignia.Service.Controllers if (req.DateReceive != null && req.Date != null) { profileInsignia.Status = "DONE"; - if (profile.ProfileType == "OFFICER") + if (profile.ProfileType == "officer") { var profileInsigniaBody = new PostProfileInsigniaDto { @@ -2465,7 +2465,7 @@ namespace BMA.EHR.Insignia.Service.Controllers profile.Status = "DONE"; // check profile.ProfileType ก่อนส่งไประบบทะเบียนประวัติ - if (profile.ProfileType == "OFFICER") + if (profile.ProfileType == "officer") { var profileInsigniaBody = new PostProfileInsigniaDto { @@ -3170,11 +3170,11 @@ namespace BMA.EHR.Insignia.Service.Controllers foreach (var InsigniaRequest in insigniaPeriod.InsigniaRequests) { var profiles = await _context.Set() - .Where(p => p.Request.Id == InsigniaRequest.Id && p.ProfileType == req.type.Trim().ToUpper()).Select(x => x.ProfileId.ToString()).ToListAsync(); + .Where(p => p.Request.Id == InsigniaRequest.Id && p.ProfileType == req.type.Trim().ToLower()).Select(x => x.ProfileId.ToString()).ToListAsync(); if (profiles.Count > 0) { - await _insigniaPeriodRepository.UpdateInsigniaRequestProfile(profiles.ToArray(), req.type.Trim().ToUpper()); + await _insigniaPeriodRepository.UpdateInsigniaRequestProfile(profiles.ToArray(), req.type.Trim().ToLower()); } } }