noti วินัย

This commit is contained in:
kittapath 2025-02-19 17:56:02 +07:00
parent 9e513d3f1a
commit ae990c0c5f
21 changed files with 244 additions and 1508 deletions

View file

@ -104,49 +104,6 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
_appContext.Set<Notification>().Add(noti);
await _appContext.SaveChangesAsync();
//var profile_id = profile == null ? Guid.Empty : profile.Id;
//var rootOc = _userProfileRepository.GetRootOcId(profile_id, AccessToken);
//var approver = string.Empty;
//var list = new List<OrganizationApproverResponse>();
//if (rootOc != null)
//{
// list = await _commandRepository.GetOrgApproverAsync(rootOc ?? Guid.Empty);
//}
//if (list.Count > 0)
//{
// var appr = list.FirstOrDefault();
// // send inbox and notification
// var subject_str = $"มีการขออนุมัติลงเวลากรณีพิเศษ";
// var body_str = $"โปรดพิจารณาคำร้องขอลงเวลาในกรณีพิเศษจาก {profile.Prefix}{profile.FirstName} {profile.LastName} ในวันที่ {entity.CheckDate.Date.ToThaiShortDate2()}";
// var subject = subject_str;
// var body = body_str;
// _emailSenderService.SendMail(subject, body, "dev@frappet.com");
// var inbox = new Inbox
// {
// Subject = subject_str,
// Body = body_str,
// ReceiverUserId = appr.Id == Guid.Empty ? Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6") : appr.Id,
// Payload = "",
// };
// _appContext.Set<Inbox>().Add(inbox);
// var noti = new Notification
// {
// Body = body_str,
// ReceiverUserId = appr.Id == Guid.Empty ? Guid.Parse("08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6") : appr.Id,
// Type = "",
// Payload = "",
// };
// _appContext.Set<Notification>().Add(noti);
// await _appContext.SaveChangesAsync();
//}
return entity;
}