From 8411968b17fda0af548f1ded925bd064bf1bbf02 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 11 Jul 2024 00:01:49 +0700 Subject: [PATCH] no message --- .../Commands/CommandReportRepository.cs | 70 +- .../Commands/CommandRepository.cs | 912 ++++++++++++++++++ .../Controllers/NotifyController.cs | 5 +- 3 files changed, 983 insertions(+), 4 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs index 91b008a6..59d45c32 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs @@ -235,7 +235,7 @@ namespace BMA.EHR.Application.Repositories.Commands p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", - NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = p.RemarkHorizontal, RemarkVertical = p.RemarkVertical, @@ -303,7 +303,73 @@ namespace BMA.EHR.Application.Repositories.Commands p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", - NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber() + }) + .ToList(); + + return report_data; + } + catch + { + throw; + } + } + + public async Task> GetCommandType39AttachmentAsync(Guid id) + { + try + { + var raw_data = await _dbContext.Set() + .Include(c => c.Command) + .Where(c => c.Command.Id == id) + .ToListAsync(); + if (raw_data == null) + { + throw new Exception(GlobalMessages.CommandNotFound); + } + + var report_data = (from r in raw_data + join p in _dbContext.Set() + .Include(x => x.PlacementEducations) + .Include(x => x.Placement) + .Include(x => x.OrganizationPosition) + .ThenInclude(x => x.Organization) + .Include(x => x.PositionPath) + .Include(x => x.PositionLevel) + .Include(x => x.PositionNumber) + .Include(x => x.PositionType) + on r.RefPlacementProfileId equals p.Id + orderby r.Sequence + select new CommandType03Response + { + Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" : + p.PlacementEducations.FirstOrDefault().Degree, + Seq = r.Sequence.ToString().ToThaiNumber(), + CitizenId = r.CitizenId == null ? "-" : r.CitizenId.ToThaiNumber(), + FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", + OldOc = p.rootOld == null ? "" : p.rootOld, + OldPositionName = p.positionNameOld == null ? "" : p.positionNameOld, + OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld, + OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld, + OldPositionNumber = p.posMasterNoOld == null ? "" : + p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : + p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : + p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : + p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : + p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "", + OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), + NewOc = p.root == null ? "" : p.root, + NewPositionName = p.positionName == null ? "" : p.positionName, + NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName, + NewPositionType = p.posTypeName == null ? "" : p.posTypeName, + NewPositionNumber = p.posMasterNo == null ? "" : + p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() : + p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() : + p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : + p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : + p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", + NewSalary = p.Amount == null ? "" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber() }) .ToList(); diff --git a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs index dc8c6a14..4dffc876 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs @@ -3038,6 +3038,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ ตามคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -3047,6 +3053,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -3066,6 +3078,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งบรรจุเป็นข้าราชการกรุงเทพมหานครสามัญ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -3086,6 +3104,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -3196,6 +3220,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้ง เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(placementProfile.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -3205,6 +3235,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(placementProfile.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -3221,6 +3257,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้ง คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -3241,6 +3283,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -3351,6 +3399,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งย้าย เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(placementProfile.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -3360,6 +3414,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(placementProfile.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -3376,6 +3436,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งย้าย คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -3396,6 +3462,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -3506,6 +3578,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งเลื่อน เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(placementProfile.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -3515,6 +3593,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(placementProfile.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -3531,6 +3615,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งเลื่อน คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -3551,6 +3641,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -3664,6 +3760,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้ง เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -3673,6 +3775,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -3690,6 +3798,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้ง คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -3710,6 +3824,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -3821,6 +3941,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งเลื่อน เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(placementProfile.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -3830,6 +3956,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(placementProfile.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -3846,6 +3978,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งเลื่อน คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -3866,6 +4004,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -3978,6 +4122,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งย้าย เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(placementProfile.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -3987,6 +4137,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(placementProfile.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -4003,6 +4159,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งย้าย คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -4023,6 +4185,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -4130,6 +4298,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งบรรจุและแต่งตั้งข้าราชการฯ กลับเข้ารับราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(placementProfile.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -4139,6 +4313,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(placementProfile.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -4155,6 +4335,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งบรรจุและแต่งตั้งข้าราชการฯ กลับเข้ารับราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -4175,6 +4361,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -4283,6 +4475,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งบรรจุและแต่งตั้งผู้ออกไปรับราชการทหารกลับเข้ารับราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(placementProfile.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -4292,6 +4490,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(placementProfile.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -4308,6 +4512,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งบรรจุและแต่งตั้งผู้ออกไปรับราชการทหารกลับเข้ารับราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -4328,6 +4538,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -4453,6 +4669,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้งคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = data.Id, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -4462,6 +4684,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = data.Id, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -4478,6 +4706,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้งคณะกรรมการประเมินผลการทดลองปฏิบัติหน้าที่ราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -4498,6 +4732,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -4585,6 +4825,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้ข้าราชการที่มีผลการทดลองปฏิบัติหน้าที่ราชการไม่ต่ำกว่ามาตรฐานที่กำหนดรับราชการต่อไป เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -4594,6 +4840,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -4610,6 +4862,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้ข้าราชการที่มีผลการทดลองปฏิบัติหน้าที่ราชการไม่ต่ำกว่ามาตรฐานที่กำหนดรับราชการต่อไป คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -4630,6 +4888,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -4717,6 +4981,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งให้ข้าราชการออกจากราชการเพราะผลการทดลองปฏิบัติหน้าที่ราชการต่ำกว่ามาตรฐานที่กำหนด เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -4726,6 +4996,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -4742,6 +5018,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้ข้าราชการออกจากราชการเพราะผลการทดลองปฏิบัติหน้าที่ราชการต่ำกว่ามาตรฐานที่กำหนด คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -4762,6 +5044,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -4882,6 +5170,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้โอนข้าราชการกรุงเทพมหานครสามัญ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -4891,6 +5185,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -4907,6 +5207,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้โอนข้าราชการกรุงเทพมหานครสามัญ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -4927,6 +5233,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5043,6 +5355,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับโอนเป็นข้าราชการกรุงเทพมหานครสามัญ ตามคำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(placementProfile.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -5052,6 +5370,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(placementProfile.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5069,6 +5393,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งรับโอนข้าราชการกรุงเทพมหานครสามัญ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -5089,6 +5419,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5197,6 +5533,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้ช่วยราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(data.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -5206,6 +5548,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(data.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5223,6 +5571,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้ช่วยราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -5243,6 +5597,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5352,6 +5712,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งส่งตัวกลับ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(data.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -5361,6 +5727,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(data.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5378,6 +5750,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งส่งตัวกลับ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -5398,6 +5776,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5522,6 +5906,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งอนุญาตให้ข้าราชการลาออกจากราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(data.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -5531,6 +5921,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(data.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5548,6 +5944,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งอนุญาตให้ข้าราชการลาออกจากราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -5568,6 +5970,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5692,6 +6100,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งให้ออกจากราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(data.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -5701,6 +6115,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(data.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5718,6 +6138,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้ออกจากราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -5738,6 +6164,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5825,6 +6257,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งปลดออกจากราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -5834,6 +6272,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -5870,6 +6314,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งปลดออกจากราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -5890,6 +6340,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -5977,6 +6433,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งไล่ออกจากราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -5986,6 +6448,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -6022,6 +6490,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งไล่ออกจากราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -6042,6 +6516,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6117,6 +6597,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้งลูกจ้างชั่วคราวเป็นลูกจ้างประจำ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -6126,6 +6612,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -6142,6 +6634,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้งลูกจ้างชั่วคราวเป็นลูกจ้างประจำ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -6162,6 +6660,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6273,6 +6777,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งจ้างและแต่งตั้งลูกจ้างประจำ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(data.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -6282,6 +6792,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(data.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6299,6 +6815,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้งลูกจ้างประจำ(ปรับระดับชั้นงาน) คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -6319,6 +6841,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6403,6 +6931,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งให้ลูกจ้างออกจากราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(data.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -6412,6 +6946,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(data.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6429,6 +6969,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้ลูกจ้างออกจากราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -6449,6 +6995,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6560,6 +7112,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งจ้างและแต่งตั้งลูกจ้างประจำ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(data.profileId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -6569,6 +7127,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(data.profileId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6586,6 +7150,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งแต่งตั้งลูกจ้างประจำ(ย้าย) คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -6606,6 +7176,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6694,6 +7270,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งพักจากราชการ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -6703,6 +7285,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -6718,6 +7306,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งพักจากราชการ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -6738,6 +7332,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6828,6 +7428,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งให้ออกจากราชการไว้ก่อน เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -6837,6 +7443,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -6852,6 +7464,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งให้ออกจากราชการไว้ก่อน คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -6872,6 +7490,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -6962,6 +7586,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งลงโทษ ภาคทัณฑ์ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -6971,6 +7601,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -6986,6 +7622,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งลงโทษ ภาคทัณฑ์ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -7006,6 +7648,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -7096,6 +7744,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งลงโทษ ตัดเงินเดือน เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -7105,6 +7759,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -7120,6 +7780,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งลงโทษ ตัดเงินเดือน คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -7140,6 +7806,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -7230,6 +7902,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งลงโทษ ลดขั้นเงินเดือน เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -7239,6 +7917,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -7254,6 +7938,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งลงโทษ ลดขั้นเงินเดือน คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -7274,6 +7964,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -7364,6 +8060,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งเพิ่มโทษ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -7373,6 +8075,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -7388,6 +8096,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งเพิ่มโทษ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -7408,6 +8122,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -7498,6 +8218,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งงดโทษ เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -7507,6 +8233,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -7522,6 +8254,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งงดโทษ คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -7542,6 +8280,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -7632,6 +8376,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งยุติเรื่อง เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -7641,6 +8391,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -7656,6 +8412,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งยุติเรื่อง คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -7676,6 +8438,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -7750,6 +8518,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งยุติเรื่อง เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -7759,6 +8533,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -7774,6 +8554,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งยุติเรื่อง คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -7794,6 +8580,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -7868,6 +8660,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งยุติเรื่อง เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -7877,6 +8675,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -7892,6 +8696,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งยุติเรื่อง คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -7912,6 +8722,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -7985,6 +8801,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งยุติเรื่อง เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -7994,6 +8816,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -8009,6 +8837,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งยุติเรื่อง คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -8029,6 +8863,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -8103,6 +8943,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งยุติเรื่อง เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -8112,6 +8958,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -8127,6 +8979,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งยุติเรื่อง คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -8147,6 +9005,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -8221,6 +9085,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คุณได้รับคำสั่งยุติเรื่อง เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = recv.RefPlacementProfileId.Value, Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); @@ -8230,6 +9100,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = recv.RefPlacementProfileId.Value, Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); await _dbContext.SaveChangesAsync(); @@ -8245,6 +9121,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งยุติเรื่อง คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -8265,6 +9147,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } @@ -8336,6 +9224,12 @@ namespace BMA.EHR.Application.Repositories.Commands // Body = $"คุณได้รับคำสั่งยุติเรื่อง เลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", // ReceiverUserId = recv.RefPlacementProfileId.Value, // Payload = payload_str, + // CreatedFullName = FullName ?? "System Administrator", + // CreatedUserId = UserId ?? "", + // CreatedAt = DateTime.Now, + // LastUpdateFullName = FullName ?? "System Administrator", + // LastUpdateUserId = UserId ?? "", + // LastUpdatedAt = DateTime.Now, // }; // _dbContext.Set().Add(inbox); @@ -8345,6 +9239,12 @@ namespace BMA.EHR.Application.Repositories.Commands // ReceiverUserId = recv.RefPlacementProfileId.Value, // Type = "LINK", // Payload = payload_str, + // CreatedFullName = FullName ?? "System Administrator", + // CreatedUserId = UserId ?? "", + // CreatedAt = DateTime.Now, + // LastUpdateFullName = FullName ?? "System Administrator", + // LastUpdateUserId = UserId ?? "", + // LastUpdatedAt = DateTime.Now, // }; // _dbContext.Set().Add(noti); // await _dbContext.SaveChangesAsync(); @@ -8360,6 +9260,12 @@ namespace BMA.EHR.Application.Repositories.Commands Body = $"คำสั่งยุติเรื่อง คำสั่งเลขที่ {command.CommandNo}/{command.CommandYear.ToInteger().ToThaiYear()} ลงวันที่ {command.CommandExcecuteDate.Value.ToThaiFullDate3()}", ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(inbox); } @@ -8380,6 +9286,12 @@ namespace BMA.EHR.Application.Repositories.Commands ReceiverUserId = Guid.Parse(cc.ReceiveUserId), Type = "LINK", Payload = payload_str, + CreatedFullName = FullName ?? "System Administrator", + CreatedUserId = UserId ?? "", + CreatedAt = DateTime.Now, + LastUpdateFullName = FullName ?? "System Administrator", + LastUpdateUserId = UserId ?? "", + LastUpdatedAt = DateTime.Now, }; _dbContext.Set().Add(noti); } diff --git a/BMA.EHR.Placement.Service/Controllers/NotifyController.cs b/BMA.EHR.Placement.Service/Controllers/NotifyController.cs index b357c259..9d7b6ca7 100644 --- a/BMA.EHR.Placement.Service/Controllers/NotifyController.cs +++ b/BMA.EHR.Placement.Service/Controllers/NotifyController.cs @@ -144,9 +144,10 @@ namespace BMA.EHR.Placement.Service.Controllers var inbox = await _context.Inboxes.FirstOrDefaultAsync(x => x.Id == id); if (inbox == null) return Error(GlobalMessages.DataNotFound); + if (inbox.CreatedUserId == null || inbox.CreatedUserId == "") + return Error("ข้อความนี้เป็นการแจ้งเตือนจากระบบไม่สามารถตอบกลับได้"); - - var apiUrl = $"{_configuration["API"]}/org/profile/keycloak/position/{inbox.CreatedUserId}"; + var apiUrl = $"{_configuration["API"]}/org/profile/keycloakid/position/{inbox.CreatedUserId}"; using (var client = new HttpClient()) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));