From 7d4642a2f3c533fb531c13e5a8f204670d474176 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Mon, 27 Jan 2025 11:42:09 +0700 Subject: [PATCH] =?UTF-8?q?=20fix=20issue=20:=20SIT=20=E0=B8=A3=E0=B8=B0?= =?UTF-8?q?=E0=B8=9A=E0=B8=9A=E0=B8=9A=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B6?= =?UTF-8?q?=E0=B8=81=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=B2>>?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5?= =?UTF-8?q?=E0=B8=B2=20(=E0=B8=81=E0=B8=A3=E0=B8=93=E0=B8=B5=E0=B8=82?= =?UTF-8?q?=E0=B8=AD=E0=B8=A2=E0=B8=81=E0=B9=80=E0=B8=A5=E0=B8=B4=E0=B8=81?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=B2)=20#935?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LeaveRequests/LeaveRequestRepository.cs | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs index f2a014bc..ee236abe 100644 --- a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs @@ -431,25 +431,23 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests await UpdateAsync(rawData); + // fix issue : SIT ระบบบันทึกการลา>>รายการลา (กรณีขอยกเลิกการลา) #935 // TODO: remove วันลา - var leaveType = await _appDbContext.Set() - .FirstOrDefaultAsync(x => x.Name == rawData.Type.Name); - - + //var leaveType = await _appDbContext.Set() + // .FirstOrDefaultAsync(x => x.Name == rawData.Type.Name); + // insert to profile leave - var profileLeave = await _appDbContext.Set() - .Where(x => x.TypeLeave.Id == leaveType.Id) - .Where(x => x.ProfileId == profile.Id) - .Where(x => x.DateStartLeave == rawData.LeaveStartDate && x.DateEndLeave == rawData.LeaveEndDate) - .FirstOrDefaultAsync(); - if (profileLeave != null) - { - _appDbContext.Set().Remove(profileLeave); - await _appDbContext.SaveChangesAsync(); - } - - // insert into process timestamp + //var profileLeave = await _appDbContext.Set() + // .Where(x => x.TypeLeave.Id == leaveType.Id) + // .Where(x => x.ProfileId == profile.Id) + // .Where(x => x.DateStartLeave == rawData.LeaveStartDate && x.DateEndLeave == rawData.LeaveEndDate) + // .FirstOrDefaultAsync(); + //if (profileLeave != null) + //{ + // _appDbContext.Set().Remove(profileLeave); + // await _appDbContext.SaveChangesAsync(); + //} // Send Noti