check type insignia

This commit is contained in:
moss 2025-05-30 10:58:15 +07:00
parent 96246d5853
commit db84cdbf29
3 changed files with 20 additions and 20 deletions

View file

@ -9111,7 +9111,7 @@ namespace BMA.EHR.Application.Repositories
LastUpdatedAt = DateTime.Now, LastUpdatedAt = DateTime.Now,
// Add Information for reused in API Call // Add Information for reused in API Call
ProfileType = item.ProfileType ?? "officer", ProfileType = item.ProfileType != null && item.ProfileType != "" ? item.ProfileType.ToLower() : "officer",
Prefix = item.Prefix, Prefix = item.Prefix,
FirstName = item.FirstName, FirstName = item.FirstName,
LastName = item.LastName, LastName = item.LastName,
@ -9221,7 +9221,7 @@ namespace BMA.EHR.Application.Repositories
LastUpdatedAt = DateTime.Now, LastUpdatedAt = DateTime.Now,
// Add Information for reused in API Call // Add Information for reused in API Call
ProfileType = item.ProfileType ?? "officer", ProfileType = item.ProfileType != null && item.ProfileType != "" ? item.ProfileType.ToLower() : "officer",
Prefix = item.Prefix, Prefix = item.Prefix,
FirstName = item.FirstName, FirstName = item.FirstName,
LastName = item.LastName, LastName = item.LastName,

View file

@ -1167,7 +1167,7 @@ namespace BMA.EHR.Application.Repositories.Reports
if (matchedData != null) if (matchedData != null)
{ {
resultList.Add(new resultList.Add(new
{ {
rowNo = seq++.ToString().ToThaiNumber(), rowNo = seq++.ToString().ToThaiNumber(),
d.ProfileId, d.ProfileId,
d.FullName, d.FullName,
@ -1342,10 +1342,10 @@ namespace BMA.EHR.Application.Repositories.Reports
ResultOCT3 = d.ResultOCT3 ?? "-", ResultOCT3 = d.ResultOCT3 ?? "-",
ResultAPR4 = d.ResultAPR4 ?? "-", ResultAPR4 = d.ResultAPR4 ?? "-",
ResultOCT4 = d.ResultOCT4 ?? "-", ResultOCT4 = d.ResultOCT4 ?? "-",
ResultAPR5 = d.ResultAPR5 ?? "-", ResultAPR5 = d.ResultAPR5 ?? "-",
ResultOCT5 = d.ResultOCT5 ?? "-", ResultOCT5 = d.ResultOCT5 ?? "-",
Remark = d.Reason ?? "-" Remark = d.Reason ?? "-"
}); });
} }
return resultList; return resultList;
@ -1545,11 +1545,11 @@ namespace BMA.EHR.Application.Repositories.Reports
if (type == "officer") 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") 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) switch (node)
@ -1618,11 +1618,11 @@ namespace BMA.EHR.Application.Repositories.Reports
if (type == "officer") 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") 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) switch (node)
@ -1691,11 +1691,11 @@ namespace BMA.EHR.Application.Repositories.Reports
if (type == "officer") 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") 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) switch (node)

View file

@ -334,7 +334,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
// // บันทึกรายชื่อ // // บันทึกรายชื่อ
// await _repository.InsertCandidate(period, ocId, candidate); // 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)) resend.Items = (await _repository.InsigniaHasProfile(result.PeriodId, ocId, status, type))
.Where(x => x.ProfileType!.ToLower() == type.ToLower()).ToList(); .Where(x => x.ProfileType!.ToLower() == type.ToLower()).ToList();
@ -453,7 +453,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
// // บันทึกรายชื่อ // // บันทึกรายชื่อ
// await _repository.InsertCandidate(period, ocId, candidate); // 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); resend.Items = await _repository.InsigniaHasProfile(result.PeriodId, ocId, status);
return Success(resend); 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 //var resultData = allEmployeeProfileByRoot.Select(x => new
//{ //{
@ -1168,7 +1168,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
LastUpdateUserId = UserId ?? "", LastUpdateUserId = UserId ?? "",
LastUpdatedAt = DateTime.Now, LastUpdatedAt = DateTime.Now,
// Add Information for reused in API Call // Add Information for reused in API Call
ProfileType = profile.ProfileType ?? "officer", ProfileType = profile.ProfileType != null && profile.ProfileType != "" ? profile.ProfileType.ToLower() : "officer",
Prefix = profile.Prefix, Prefix = profile.Prefix,
FirstName = profile.FirstName, FirstName = profile.FirstName,
LastName = profile.LastName, LastName = profile.LastName,
@ -2139,7 +2139,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
{ {
insigniaNoteProfile.Status = "DONE"; insigniaNoteProfile.Status = "DONE";
if (profile.ProfileType == "OFFICER") if (profile.ProfileType == "officer")
{ {
var profileInsigniaBody = new PostProfileInsigniaDto var profileInsigniaBody = new PostProfileInsigniaDto
{ {
@ -2207,7 +2207,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
if (req.DateReceive != null && req.Date != null) if (req.DateReceive != null && req.Date != null)
{ {
profileInsignia.Status = "DONE"; profileInsignia.Status = "DONE";
if (profile.ProfileType == "OFFICER") if (profile.ProfileType == "officer")
{ {
var profileInsigniaBody = new PostProfileInsigniaDto var profileInsigniaBody = new PostProfileInsigniaDto
{ {
@ -2465,7 +2465,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
profile.Status = "DONE"; profile.Status = "DONE";
// check profile.ProfileType ก่อนส่งไประบบทะเบียนประวัติ // check profile.ProfileType ก่อนส่งไประบบทะเบียนประวัติ
if (profile.ProfileType == "OFFICER") if (profile.ProfileType == "officer")
{ {
var profileInsigniaBody = new PostProfileInsigniaDto var profileInsigniaBody = new PostProfileInsigniaDto
{ {
@ -3170,11 +3170,11 @@ namespace BMA.EHR.Insignia.Service.Controllers
foreach (var InsigniaRequest in insigniaPeriod.InsigniaRequests) foreach (var InsigniaRequest in insigniaPeriod.InsigniaRequests)
{ {
var profiles = await _context.Set<InsigniaRequestProfile>() var profiles = await _context.Set<InsigniaRequestProfile>()
.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) if (profiles.Count > 0)
{ {
await _insigniaPeriodRepository.UpdateInsigniaRequestProfile(profiles.ToArray(), req.type.Trim().ToUpper()); await _insigniaPeriodRepository.UpdateInsigniaRequestProfile(profiles.ToArray(), req.type.Trim().ToLower());
} }
} }
} }