This commit is contained in:
parent
7bfa69e19e
commit
a2efb8d9af
1 changed files with 47 additions and 30 deletions
|
|
@ -125,6 +125,20 @@ namespace BMA.EHR.Application.Repositories
|
||||||
else if (rawData.ApproveStep == "st3")
|
else if (rawData.ApproveStep == "st3")
|
||||||
{
|
{
|
||||||
rawData.ApproveStep = "st4";
|
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-detail/{id}",
|
||||||
|
};
|
||||||
|
_dbContext.Set<Notification>().Add(_noti1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Send notification to 1st Commander
|
// TODO: Send notification to 1st Commander
|
||||||
|
|
@ -206,26 +220,26 @@ namespace BMA.EHR.Application.Repositories
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rawData.Status = "PENDING";
|
rawData.Status = "PENDING";
|
||||||
// if (rawData.Group != "1.1")
|
|
||||||
// {
|
|
||||||
rawData.ApproveStep = "st3";
|
rawData.ApproveStep = "st3";
|
||||||
// }
|
|
||||||
|
|
||||||
// TODO: Send notification to 1st Approver
|
if (rawData.Group == "1.1")
|
||||||
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} รอรับการอนุมัติจากคุณ",
|
// TODO: Send notification to 1st Approver
|
||||||
ReceiverUserId = firstCommander!.ProfileId,
|
var firstCommander = rawData.Approvers
|
||||||
Type = "",
|
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
|
||||||
Payload = $"{URL}/retirement/resign-detail/{id}",
|
.OrderBy(x => x.Seq)
|
||||||
};
|
.FirstOrDefault();
|
||||||
_dbContext.Set<Notification>().Add(noti1);
|
|
||||||
|
// Send Notification
|
||||||
|
var noti1 = new Notification
|
||||||
|
{
|
||||||
|
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
|
||||||
|
ReceiverUserId = firstCommander!.ProfileId,
|
||||||
|
Type = "",
|
||||||
|
Payload = $"{URL}/retirement/resign-detail/{id}",
|
||||||
|
};
|
||||||
|
_dbContext.Set<Notification>().Add(noti1);
|
||||||
|
}
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -301,20 +315,23 @@ namespace BMA.EHR.Application.Repositories
|
||||||
rawData.ApproveStep = "st3";
|
rawData.ApproveStep = "st3";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// TODO: Send notification to 1st Approver
|
if (rawData.Group == "1.1")
|
||||||
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} รอรับการอนุมัติจากคุณ",
|
// TODO: Send notification to 1st Approver
|
||||||
ReceiverUserId = firstCommander!.ProfileId,
|
var firstCommander = rawData.Approvers
|
||||||
Type = "",
|
.Where(x => x.ApproveType!.ToUpper() == "APPROVER")
|
||||||
Payload = $"{URL}/retirement/resign-detail/{id}",
|
.OrderBy(x => x.Seq)
|
||||||
};
|
.FirstOrDefault();
|
||||||
_dbContext.Set<Notification>().Add(noti1);
|
// Send Notification
|
||||||
|
var noti1 = new Notification
|
||||||
|
{
|
||||||
|
Body = $"การขอลาออกของคุณ {rawData.firstName} {rawData.lastName} รอรับการอนุมัติจากคุณ",
|
||||||
|
ReceiverUserId = firstCommander!.ProfileId,
|
||||||
|
Type = "",
|
||||||
|
Payload = $"{URL}/retirement/resign-detail/{id}",
|
||||||
|
};
|
||||||
|
_dbContext.Set<Notification>().Add(noti1);
|
||||||
|
}
|
||||||
await _dbContext.SaveChangesAsync();
|
await _dbContext.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue