แก้ชื่อ noti

This commit is contained in:
moss 2025-06-04 18:24:30 +07:00
parent b260e4067f
commit d539f6fa4a
2 changed files with 47 additions and 19 deletions

View file

@ -170,6 +170,20 @@ namespace BMA.EHR.Application.Repositories
else if (rawData.ApproveStep == "st3")
{
rawData.ApproveStep = "st4";
// TODO: Send notification to 1st Approver
var _firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var _noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = _firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-employee-detail/{id}",
};
_dbContext.Set<Notification>().Add(_noti1);
}
await _dbContext.SaveChangesAsync();
@ -599,6 +613,20 @@ namespace BMA.EHR.Application.Repositories
else if (rawData.ApproveStep == "st3")
{
rawData.ApproveStep = "st4";
// TODO: Send notification to 1st Approver
var _firstCommander = rawData.Approvers
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
.OrderBy(x => x.Seq)
.FirstOrDefault();
// Send Notification
var _noti1 = new Notification
{
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = _firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-employee-detail/{id}",
};
_dbContext.Set<Notification>().Add(_noti1);
}
await _dbContext.SaveChangesAsync();
@ -611,7 +639,7 @@ namespace BMA.EHR.Application.Repositories
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-employee-detail/{id}",
@ -699,7 +727,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-employee-detail/{id}",
@ -726,7 +754,7 @@ namespace BMA.EHR.Application.Repositories
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-employee-detail/{id}",
@ -788,7 +816,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-employee-detail/{id}",
@ -816,7 +844,7 @@ namespace BMA.EHR.Application.Repositories
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-employee-detail/{id}",
@ -876,7 +904,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = "",
@ -900,7 +928,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณได้รับการอนุมัติ",
Body = $"การขอยกเลิกลาออกของคุณได้รับการอนุมัติ",
ReceiverUserId = Guid.Parse(rawData.profileId),
Type = "",
Payload = "",
@ -960,7 +988,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = "",
@ -984,7 +1012,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณไม่ได้รับการอนุมัติ \r\nเนื่องจาก{reason}",
Body = $"การขอยกเลิกลาออกของคุณไม่ได้รับการอนุมัติ \r\nเนื่องจาก{reason}",
ReceiverUserId = Guid.Parse(rawData.profileId),
Type = "",
Payload = "",

View file

@ -547,7 +547,7 @@ namespace BMA.EHR.Application.Repositories
// Send Notification
var _noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = _firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
@ -563,7 +563,7 @@ namespace BMA.EHR.Application.Repositories
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
@ -623,7 +623,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
@ -647,7 +647,7 @@ namespace BMA.EHR.Application.Repositories
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
@ -710,7 +710,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
@ -739,7 +739,7 @@ namespace BMA.EHR.Application.Repositories
// Send Notification
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = firstCommander!.ProfileId,
Type = "",
Payload = $"{URL}/retirement/resign-detail/{id}",
@ -800,7 +800,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = "",
@ -826,7 +826,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณได้รับการอนุมัติ",
Body = $"การขอยกเลิกลาออกของคุณได้รับการอนุมัติ",
ReceiverUserId = Guid.Parse(rawData.profileId),
Type = "",
Payload = "",
@ -887,7 +887,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti1 = new Notification
{
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
Body = $"การขอยกเลิกลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
ReceiverUserId = nextApprover!.ProfileId,
Type = "",
Payload = "",
@ -910,7 +910,7 @@ namespace BMA.EHR.Application.Repositories
// Send Noti
var noti = new Notification
{
Body = $"การขอลาออกของคุณไม่ได้รับการอนุมัติ \r\nเนื่องจาก{reason}",
Body = $"การขอยกเลิกลาออกของคุณไม่ได้รับการอนุมัติ \r\nเนื่องจาก{reason}",
ReceiverUserId = Guid.Parse(rawData.profileId),
Type = "",
Payload = "",