diff --git a/.github/workflows/release_leave.yaml b/.github/workflows/release_leave.yaml index b017222d..4b361f5f 100644 --- a/.github/workflows/release_leave.yaml +++ b/.github/workflows/release_leave.yaml @@ -57,7 +57,7 @@ jobs: push: true tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest - name: Remote Deployment - uses: appleboy/ssh-action@v0.1.8 + uses: appleboy/ssh-action@v1 with: host: ${{env.DEPLOY_HOST}} username: frappet diff --git a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs index aed8b720..66051840 100644 --- a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs @@ -1573,9 +1573,9 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests Root = organizationName, SumLeaveDay = grp.Sum(x => x.LeaveTotal), sickDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-001").Sum(x => x.LeaveTotal), - maternityDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-002").Sum(x => x.LeaveTotal), - wifeDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-003").Sum(x => x.LeaveTotal), - personalDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-004").Sum(x => x.LeaveTotal), + personalDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-002").Sum(x => x.LeaveTotal), + maternityDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-003").Sum(x => x.LeaveTotal), + wifeDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-004").Sum(x => x.LeaveTotal), restDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-005").Sum(x => x.LeaveTotal), ordainDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-006").Sum(x => x.LeaveTotal), absentDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-007").Sum(x => x.LeaveTotal), @@ -1585,9 +1585,9 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests therapyDayCountMale = grp.Where(x => x.Gender == "ชาย" && x.LeaveTypeCode == "LV-011").Sum(x => x.LeaveTotal), sickDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-001").Sum(x => x.LeaveTotal), - maternityDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-002").Sum(x => x.LeaveTotal), - wifeDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-003").Sum(x => x.LeaveTotal), - personalDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-004").Sum(x => x.LeaveTotal), + personalDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-002").Sum(x => x.LeaveTotal), + maternityDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-003").Sum(x => x.LeaveTotal), + wifeDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-004").Sum(x => x.LeaveTotal), restDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-005").Sum(x => x.LeaveTotal), ordainDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-006").Sum(x => x.LeaveTotal), absentDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-007").Sum(x => x.LeaveTotal), @@ -1597,9 +1597,9 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests therapyDayCountFemale = grp.Where(x => x.Gender == "หญิง" && x.LeaveTypeCode == "LV-011").Sum(x => x.LeaveTotal), sickDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-001").Sum(x => x.LeaveTotal), - maternityDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-002").Sum(x => x.LeaveTotal), - wifeDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-003").Sum(x => x.LeaveTotal), - personalDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-004").Sum(x => x.LeaveTotal), + personalDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-002").Sum(x => x.LeaveTotal), + maternityDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-003").Sum(x => x.LeaveTotal), + wifeDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-004").Sum(x => x.LeaveTotal), restDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-005").Sum(x => x.LeaveTotal), ordainDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-006").Sum(x => x.LeaveTotal), absentDayCountNo = grp.Where(x => x.Gender != "ชาย" && x.Gender != "หญิง" && x.LeaveTypeCode == "LV-007").Sum(x => x.LeaveTotal), diff --git a/BMA.EHR.Insignia/Controllers/InsigniaManageController.cs b/BMA.EHR.Insignia/Controllers/InsigniaManageController.cs index 20d0debb..aaf9dffc 100644 --- a/BMA.EHR.Insignia/Controllers/InsigniaManageController.cs +++ b/BMA.EHR.Insignia/Controllers/InsigniaManageController.cs @@ -623,7 +623,7 @@ namespace BMA.EHR.Insignia.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Leave/Controllers/LeaveController.cs b/BMA.EHR.Leave/Controllers/LeaveController.cs index e8eb61f2..89d3b401 100644 --- a/BMA.EHR.Leave/Controllers/LeaveController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveController.cs @@ -322,6 +322,14 @@ namespace BMA.EHR.Leave.Service.Controllers oldData.IsDefault = data.IsDefault; oldData.IsActive = data.IsActive; + if (!data.IsActive) + { + // ลบรายการที่เคยผูกไว้ทั้งหมด + var userDutyTimes = await _context.UserDutyTimes.Where(x => x.DutyTimeId == oldData.Id).ToListAsync(); + _context.UserDutyTimes.RemoveRange(userDutyTimes); + await _context.SaveChangesAsync(); + } + await _dutyTimeRepository.UpdateAsync(oldData); return Success(oldData); @@ -1296,7 +1304,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -1592,7 +1600,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -2429,7 +2437,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Leave/Controllers/LeaveReportController.cs b/BMA.EHR.Leave/Controllers/LeaveReportController.cs index 703ca37f..9a32e247 100644 --- a/BMA.EHR.Leave/Controllers/LeaveReportController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveReportController.cs @@ -918,7 +918,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -1535,7 +1535,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -1861,7 +1861,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -2133,52 +2133,64 @@ namespace BMA.EHR.Leave.Service.Controllers int colCount = 10; int totalRows = employees.Count; - // เตรียม List สำหรับใช้กับ LoadFromArrays - var data = new List(totalRows); - for (int i = 0; i < totalRows; i++) + // ตรวจสอบว่ามีข้อมูลหรือไม่ + if (totalRows > 0) { - var emp = employees[i]; - data.Add(new object[] + // เตรียม List สำหรับใช้กับ LoadFromArrays + var data = new List(totalRows); + for (int i = 0; i < totalRows; i++) { - emp.no, - emp.fullName, - emp.dutyTimeName, - emp.checkInDate, - emp.checkInLocation, - emp.checkInTime, - emp.checkedOutDate, - emp.checkOutLocation, - emp.checkOutTime, - emp.remark - }); + var emp = employees[i]; + data.Add(new object[] + { + emp.no, + emp.fullName, + emp.dutyTimeName, + emp.checkInDate, + emp.checkInLocation, + emp.checkInTime, + emp.checkedOutDate, + emp.checkOutLocation, + emp.checkOutTime, + emp.remark + }); + } + + // เขียนข้อมูลลง Excel ครั้งเดียว + worksheet.Cells[startRow, 1].LoadFromArrays(data); + + // กำหนดสไตล์ตัวบาง + ขอบ + using (var range = worksheet.Cells[startRow, 1, startRow + totalRows - 1, colCount]) + { + range.Style.Font.Bold = false; + range.Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin; + range.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin; + range.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin; + range.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin; + range.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top; + + // Center Align: คอลัมน์ 1 (A), 3 (C), 4 (D), 6 (F), 7 (G), 9 (I) + var centerColumns = new[] { 1, 3, 4, 6, 7, 9 }; + foreach (var col in centerColumns) + { + worksheet.Cells[startRow, col, startRow + totalRows - 1, col].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; + } + + // Left Align: คอลัมน์ 2 (B), 5 (E), 8 (H), 10 (J) + var leftColumns = new[] { 2, 5, 8, 10 }; + foreach (var col in leftColumns) + { + worksheet.Cells[startRow, col, startRow + totalRows - 1, col].Style.HorizontalAlignment = ExcelHorizontalAlignment.Left; + } + } } - - // เขียนข้อมูลลง Excel ครั้งเดียว - worksheet.Cells[startRow, 1].LoadFromArrays(data); - - // กำหนดสไตล์ตัวบาง + ขอบ - using (var range = worksheet.Cells[startRow, 1, startRow + totalRows - 1, colCount]) + else { - range.Style.Font.Bold = false; - range.Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin; - range.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin; - range.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin; - range.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin; - range.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top; - - // Center Align: คอลัมน์ 1 (A), 3 (C), 4 (D), 6 (F), 7 (G), 9 (I) - var centerColumns = new[] { 1, 3, 4, 6, 7, 9 }; - foreach (var col in centerColumns) - { - worksheet.Cells[startRow, col, startRow + totalRows - 1, col].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; - } - - // Left Align: คอลัมน์ 2 (B), 5 (E), 8 (H), 10 (J) - var leftColumns = new[] { 2, 5, 8, 10 }; - foreach (var col in leftColumns) - { - worksheet.Cells[startRow, col, startRow + totalRows - 1, col].Style.HorizontalAlignment = ExcelHorizontalAlignment.Left; - } + // กรณีไม่มีข้อมูล ใส่ข้อความแจ้ง + worksheet.Cells[startRow, 1].Value = "ไม่มีข้อมูล"; + worksheet.Cells[startRow, 1, startRow, colCount].Merge = true; + worksheet.Cells[startRow, 1].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center; + worksheet.Cells[startRow, 1].Style.Font.Bold = true; } // ส่วนสรุปท้ายตาราง @@ -2267,7 +2279,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -2376,7 +2388,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs index 7808b7b5..9c8be6b8 100644 --- a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs @@ -1635,7 +1635,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -1820,7 +1820,7 @@ namespace BMA.EHR.Leave.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index fb5aa8d4..d0cc4f7a 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -13,6 +13,7 @@ using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Swashbuckle.AspNetCore.Annotations; +using System.Diagnostics; using System.Net.Http.Headers; using System.Security.Claims; @@ -99,7 +100,7 @@ namespace BMA.EHR.Placement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -229,7 +230,12 @@ namespace BMA.EHR.Placement.Service.Controllers else if (role == "NORMAL") { placementAppointments = placementAppointments - .Where(x => node == 0 ? x.child1DnaId == null : (node == 1 ? x.child2DnaId == null : (node == 2 ? x.child3DnaId == null : (node == 3 ? x.child4DnaId == null : true)))).ToList(); + .Where( + x => node == 0 ? x.child1DnaId == null + : (node == 1 ? x.child1DnaId != null && x.child2DnaId == null + : (node == 2 ? x.child2DnaId != null && x.child3DnaId == null + : (node == 3 ? x.child3DnaId != null && x.child4DnaId == null : true))) + ).ToList(); } return Success(placementAppointments); } @@ -322,7 +328,7 @@ namespace BMA.EHR.Placement.Service.Controllers p.CreatedAt, p.Reason, - p.EducationOld, + EducationOld = !string.IsNullOrEmpty(p.EducationOld) ? p.EducationOld : "ปริญญาตรี", salary = p.AmountOld, p.PositionTypeOld, p.PositionLevelOld, @@ -510,6 +516,11 @@ namespace BMA.EHR.Placement.Service.Controllers placementAppointment.child4Old = org.result.child4; placementAppointment.child4OldId = org.result.child4Id; placementAppointment.child4ShortNameOld = org.result.child4ShortName; + placementAppointment.rootDnaId = org.result.rootDnaId; + placementAppointment.child1DnaId = org.result.child1DnaId; + placementAppointment.child2DnaId = org.result.child2DnaId; + placementAppointment.child3DnaId = org.result.child3DnaId; + placementAppointment.child4DnaId = org.result.child4DnaId; placementAppointment.posMasterNoOld = org.result.posMasterNo; placementAppointment.posTypeOldId = org.result.posTypeId; placementAppointment.posTypeNameOld = org.result.posTypeName; diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs index d5f67e3c..07d0c57c 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs @@ -98,7 +98,7 @@ namespace BMA.EHR.Placement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index 883c6469..79c1f0e3 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -86,7 +86,7 @@ namespace BMA.EHR.Placement.Service.Controllers { Id = x.FirstOrDefault().Year, Name = x.FirstOrDefault().Year + 543, - }).ToList(); + }).OrderByDescending(x => x.Id).ToList(); return Success(_data); } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index 23e15651..5181fa9c 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -99,7 +99,7 @@ namespace BMA.EHR.Placement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index badf80cb..4e4c28d3 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -100,7 +100,7 @@ namespace BMA.EHR.Placement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index 0501a802..59ddaec5 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -100,7 +100,7 @@ namespace BMA.EHR.Placement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index c88dce21..d0c8b7ba 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -192,7 +192,7 @@ namespace BMA.EHR.Placement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs index af64ba10..70ef8420 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs @@ -104,7 +104,7 @@ namespace BMA.EHR.Retirement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index c75eb18b..aae5b712 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -100,7 +100,7 @@ namespace BMA.EHR.Retirement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index 17953c33..dab3e661 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -115,7 +115,7 @@ namespace BMA.EHR.Retirement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index 4fe9a62a..dcfebb0b 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -257,7 +257,7 @@ namespace BMA.EHR.Retirement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -366,7 +366,7 @@ namespace BMA.EHR.Retirement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -2137,7 +2137,7 @@ namespace BMA.EHR.Retirement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs index 5ddc7d0e..d5b7037d 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -196,7 +196,7 @@ namespace BMA.EHR.Retirement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -305,7 +305,7 @@ namespace BMA.EHR.Retirement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; } @@ -2053,7 +2053,7 @@ namespace BMA.EHR.Retirement.Service.Controllers ? profileAdmin?.RootDnaId : ""; } - else if (role == "ROOT" && role == "PARENT") + else if (role == "ROOT" || role == "PARENT") { nodeId = profileAdmin?.RootDnaId; }