diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index a8d91874..c7cbf249 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -1062,12 +1062,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); @@ -1292,12 +1293,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); @@ -1506,12 +1508,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); @@ -1725,12 +1728,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); @@ -1967,12 +1971,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); @@ -2144,12 +2149,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index 1e1d5417..af1d954e 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -2032,12 +2032,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow + var now = DateTime.Now; placementProfile.ForEach(profile => { profile.PlacementStatus = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; if (req.refIds.Length > 0) { profile.commandId = req.refIds[0].commandId; @@ -2441,12 +2442,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow + var now = DateTime.Now; placementProfile.ForEach(profile => { profile.PlacementStatus = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; if (req.refIds.Length > 0) { profile.commandId = req.refIds[0].commandId; @@ -2716,12 +2718,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.PlacementStatus = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); @@ -2972,12 +2975,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.PlacementStatus = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); @@ -3211,12 +3215,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.PlacementStatus = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index 7c26a018..29d38df5 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -828,13 +828,14 @@ namespace BMA.EHR.Placement.Service.Controllers // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ var firstRef = req.refIds.FirstOrDefault(); var commandNoText = firstRef != null ? $"{firstRef.commandNo}/{firstRef.commandYear.ToThaiYear()}" : null; + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.commandNo = commandNoText; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index 262d86bd..31db814b 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -1306,12 +1306,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); Console.WriteLine($"[ReceiveReportExcecute] Saving changes to database for {data.Count} profiles"); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index 97e1e406..2cc8536d 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -686,12 +686,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index 843fa25a..a165be68 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -1212,12 +1212,13 @@ namespace BMA.EHR.Placement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ + var now = DateTime.Now; data.ForEach(profile => { profile.Status = "DONE"; profile.LastUpdateFullName = FullName ?? "System Administrator"; profile.LastUpdateUserId = UserId ?? ""; - profile.LastUpdatedAt = DateTime.Now; + profile.LastUpdatedAt = now; }); // Return resultData for Node to process directly (Linear Flow) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index 868aac4f..b1580cf5 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -926,7 +926,14 @@ namespace BMA.EHR.Retirement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + var now = DateTime.Now; + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -1183,7 +1190,14 @@ namespace BMA.EHR.Retirement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + var now = DateTime.Now; + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index ae528316..003166f9 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -712,7 +712,14 @@ namespace BMA.EHR.Retirement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + var now = DateTime.Now; + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index 1b434380..019451c5 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -2972,7 +2972,14 @@ namespace BMA.EHR.Retirement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + var now = DateTime.Now; + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -3164,7 +3171,14 @@ namespace BMA.EHR.Retirement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + var now = DateTime.Now; + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -3399,7 +3413,14 @@ namespace BMA.EHR.Retirement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + var now = DateTime.Now; + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = now; + }); data.ForEach(profile => profile.RetirementResign.Status = "CANCEL"); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs index 4449099b..dd0d850b 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -2468,7 +2468,14 @@ namespace BMA.EHR.Retirement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + var now = DateTime.Now; + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = now; + }); await _context.SaveChangesAsync(); // Return resultData for Node to process directly (Linear Flow) @@ -2700,7 +2707,14 @@ namespace BMA.EHR.Retirement.Service.Controllers #endregion // New: Linear Flow - Task #224 ปรับให้เป็น process ที่ควรบันทึกตามลำดับ - data.ForEach(profile => profile.Status = "DONE"); + var now = DateTime.Now; + data.ForEach(profile => + { + profile.Status = "DONE"; + profile.LastUpdateFullName = FullName ?? "System Administrator"; + profile.LastUpdateUserId = UserId ?? ""; + profile.LastUpdatedAt = now; + }); data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL"); await _context.SaveChangesAsync();