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,
// 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 +9221,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,

View file

@ -1545,11 +1545,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)
@ -1618,11 +1618,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)
@ -1691,11 +1691,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)

View file

@ -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<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)
{
await _insigniaPeriodRepository.UpdateInsigniaRequestProfile(profiles.ToArray(), req.type.Trim().ToUpper());
await _insigniaPeriodRepository.UpdateInsigniaRequestProfile(profiles.ToArray(), req.type.Trim().ToLower());
}
}
}