From b63b31608d97f554c3358f7563ef71c15ba378b1 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 28 Sep 2023 12:51:36 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9A=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B6?= =?UTF-8?q?=E0=B8=81=E0=B8=A7=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=AA=E0=B9=88=E0=B8=87=E0=B8=95=E0=B8=B1=E0=B8=A7=E0=B8=81?= =?UTF-8?q?=E0=B8=A5=E0=B8=B1=E0=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlacementRepatriationController.cs | 50 ++++++++++--------- .../PlacementRepatriationEditRequest.cs | 1 + 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index a046a69a..fb4e78aa 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -84,6 +84,7 @@ namespace BMA.EHR.Placement.Service.Controllers p.PositionNumberOld, p.OrganizationPositionOld, p.IsActive, + p.DateRepatriation, }) .ToListAsync(); if (PlacementAdmin == true) @@ -129,6 +130,7 @@ namespace BMA.EHR.Placement.Service.Controllers p.PositionLevelOld, p.PositionNumberOld, p.OrganizationPositionOld, + p.DateRepatriation, Avatar = p.Profile.Avatar == null ? Guid.Parse("00000000-0000-0000-0000-000000000000") : p.Profile.Avatar.Id, }) .FirstOrDefaultAsync(); @@ -156,6 +158,7 @@ namespace BMA.EHR.Placement.Service.Controllers data.PositionLevelOld, data.PositionNumberOld, data.OrganizationPositionOld, + data.DateRepatriation, Avatar = data.Avatar == Guid.Parse("00000000-0000-0000-0000-000000000000") ? null : await _documentService.ImagesPath(data.Avatar), }; @@ -225,6 +228,7 @@ namespace BMA.EHR.Placement.Service.Controllers return Error(GlobalMessages.PlacementRepatriationNotFound, 404); uppdated.PositionNumberOld = req.PositionNumberOld; + uppdated.DateRepatriation = req.DateRepatriation; uppdated.OrganizationPositionOld = req.OrganizationPositionOld; uppdated.PositionLevelOld = req.PositionLevelOld; uppdated.PositionTypeOld = req.PositionTypeOld; @@ -316,30 +320,30 @@ namespace BMA.EHR.Placement.Service.Controllers return Success(); } - /// - /// วันที่ส่งตัวกลับ - /// - /// Id ส่งตัวกลับ - /// - /// - /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง - /// ไม่ได้ Login เข้าระบบ - /// เมื่อเกิดข้อผิดพลาดในการทำงาน - [HttpPut("date/{id:length(36)}")] - public async Task> UpdateDateRepatriation([FromBody] PlacementRepatriationDateRequest req, Guid id) - { - var uppdated = await _context.PlacementRepatriations - .FirstOrDefaultAsync(x => x.Id == id); - if (uppdated == null) - return Error(GlobalMessages.PlacementRepatriationNotFound, 404); - uppdated.DateRepatriation = req.Date; - uppdated.LastUpdateFullName = FullName ?? "System Administrator"; - uppdated.LastUpdateUserId = UserId ?? ""; - uppdated.LastUpdatedAt = DateTime.Now; + // /// + // /// วันที่ส่งตัวกลับ + // /// + // /// Id ส่งตัวกลับ + // /// + // /// + // /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง + // /// ไม่ได้ Login เข้าระบบ + // /// เมื่อเกิดข้อผิดพลาดในการทำงาน + // [HttpPut("date/{id:length(36)}")] + // public async Task> UpdateDateRepatriation([FromBody] PlacementRepatriationDateRequest req, Guid id) + // { + // var uppdated = await _context.PlacementRepatriations + // .FirstOrDefaultAsync(x => x.Id == id); + // if (uppdated == null) + // return Error(GlobalMessages.PlacementRepatriationNotFound, 404); + // uppdated.DateRepatriation = req.Date; + // uppdated.LastUpdateFullName = FullName ?? "System Administrator"; + // uppdated.LastUpdateUserId = UserId ?? ""; + // uppdated.LastUpdatedAt = DateTime.Now; - await _context.SaveChangesAsync(); + // await _context.SaveChangesAsync(); - return Success(); - } + // return Success(); + // } } } diff --git a/BMA.EHR.Placement.Service/Requests/PlacementRepatriationEditRequest.cs b/BMA.EHR.Placement.Service/Requests/PlacementRepatriationEditRequest.cs index 5d84f9a5..1137a695 100644 --- a/BMA.EHR.Placement.Service/Requests/PlacementRepatriationEditRequest.cs +++ b/BMA.EHR.Placement.Service/Requests/PlacementRepatriationEditRequest.cs @@ -9,6 +9,7 @@ namespace BMA.EHR.Placement.Service.Requests public string Reason { get; set; } public string? OrganizationPositionOld { get; set; } public DateTime? Date { get; set; } + public DateTime? DateRepatriation { get; set; } public string? PositionTypeOld { get; set; } public string? PositionLevelOld { get; set; } public string? PositionNumberOld { get; set; }