This commit is contained in:
parent
0451b9e3e1
commit
f71cb56a40
1 changed files with 19 additions and 18 deletions
|
|
@ -530,19 +530,8 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
|
|
||||||
// TODO : Update ไปตาราง beginning
|
// TODO : Update ไปตาราง beginning
|
||||||
if (data.ApproveStep == "st4") // ถ้ามีการอนุมัติจากผู้มีอำนาจแล้ว
|
if (data.ApproveStep == "st4") // ถ้ามีการอนุมัติจากผู้มีอำนาจแล้ว
|
||||||
await _leaveBeginningRepository.UpdateLeaveUsageAsync(data.LeaveStartDate.Year, data.Type.Id, data.KeycloakUserId, -1 * data.LeaveTotal);
|
|
||||||
|
|
||||||
// Send Noti
|
|
||||||
var noti = new Notification
|
|
||||||
{
|
{
|
||||||
Body = $"การขอยกเลิกใบลาของคุณได้รับการอนุมัติ",
|
await _leaveBeginningRepository.UpdateLeaveUsageAsync(data.LeaveStartDate.Year, data.Type.Id, data.KeycloakUserId, -1 * data.LeaveTotal);
|
||||||
ReceiverUserId = profile.Id,
|
|
||||||
Type = "",
|
|
||||||
Payload = "",
|
|
||||||
};
|
|
||||||
_appDbContext.Set<Notification>().Add(noti);
|
|
||||||
await _appDbContext.SaveChangesAsync();
|
|
||||||
|
|
||||||
|
|
||||||
var _baseAPI = _configuration["API"];
|
var _baseAPI = _configuration["API"];
|
||||||
var apiUrlSalary = $"{_baseAPI}/org/profile/leave/cancel/{data.Id}";
|
var apiUrlSalary = $"{_baseAPI}/org/profile/leave/cancel/{data.Id}";
|
||||||
|
|
@ -559,8 +548,20 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
||||||
throw new Exception("ไม่สามารถอัพเดตการยกเลิกรายการลาไปยังระบบทะเบียนประวัติ");
|
throw new Exception("ไม่สามารถอัพเดตการยกเลิกรายการลาไปยังระบบทะเบียนประวัติ");
|
||||||
//var _result = await _res.Content.ReadAsStringAsync();
|
//var _result = await _res.Content.ReadAsStringAsync();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Send Noti
|
||||||
|
var noti = new Notification
|
||||||
|
{
|
||||||
|
Body = $"การขอยกเลิกใบลาของคุณได้รับการอนุมัติ",
|
||||||
|
ReceiverUserId = profile.Id,
|
||||||
|
Type = "",
|
||||||
|
Payload = "",
|
||||||
|
};
|
||||||
|
_appDbContext.Set<Notification>().Add(noti);
|
||||||
|
await _appDbContext.SaveChangesAsync();
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue