From 6a3868fd0de28e92b43f257ddc1d681366ae0ebf Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Sun, 15 Dec 2024 20:10:13 +0700 Subject: [PATCH] =?UTF-8?q?fix=20:=20Logic=20check=20=E0=B9=80=E0=B8=95?= =?UTF-8?q?=E0=B8=B7=E0=B8=AD=E0=B8=99=E0=B8=81=E0=B8=A3=E0=B8=93=E0=B8=B5?= =?UTF-8?q?=E0=B9=80=E0=B8=8A=E0=B9=87=E0=B8=84=E0=B8=AD=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B9=80=E0=B8=8A=E0=B9=87=E0=B8=84?= =?UTF-8?q?=E0=B9=80=E0=B8=AD=E0=B8=B2=E0=B8=97=E0=B9=8C=E0=B9=81=E0=B8=A5?= =?UTF-8?q?=E0=B9=89=E0=B8=A7=20=E0=B9=83=E0=B8=99=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=99=E0=B8=99=E0=B8=B1=E0=B9=89=E0=B8=99=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BMA.EHR.Leave/Controllers/LeaveController.cs | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/BMA.EHR.Leave/Controllers/LeaveController.cs b/BMA.EHR.Leave/Controllers/LeaveController.cs index 9ff701d5..b4cd6cb6 100644 --- a/BMA.EHR.Leave/Controllers/LeaveController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveController.cs @@ -425,26 +425,26 @@ namespace BMA.EHR.Leave.Service.Controllers } else { - // ถ้า check-in + check-out ไปแล้ว - if (data.CheckIn.Date == DateTime.Now.Date) - { - return Error("คุณได้ทำการลงเวลาเข้าและออกเรียบร้อยแล้ว คุณจะสามารถลงเวลาได้อีกครั้งในวันถัดไป"); - } - if (data.CheckOut != null) { - - - ret = new CheckInResultDto + // ถ้า check-in + check-out ไปแล้ว + if (data.CheckOut.Value.Date == DateTime.Now.Date) { - StartTimeMorning = duty == null ? "00:00" : duty.StartTimeMorning, - EndTimeMorning = duty == null ? "00:00" : duty.EndTimeMorning, - StartTimeAfternoon = duty == null ? "00:00" : duty.StartTimeAfternoon, - EndTimeAfternoon = duty == null ? "00:00" : duty.EndTimeAfternoon, - Description = duty == null ? "-" : duty.Description, - CheckInTime = null, - CheckInId = null, - }; + return Error("คุณได้ทำการลงเวลาเข้าและออกเรียบร้อยแล้ว คุณจะสามารถลงเวลาได้อีกครั้งในวันถัดไป"); + } + else + { + ret = new CheckInResultDto + { + StartTimeMorning = duty == null ? "00:00" : duty.StartTimeMorning, + EndTimeMorning = duty == null ? "00:00" : duty.EndTimeMorning, + StartTimeAfternoon = duty == null ? "00:00" : duty.StartTimeAfternoon, + EndTimeAfternoon = duty == null ? "00:00" : duty.EndTimeAfternoon, + Description = duty == null ? "-" : duty.Description, + CheckInTime = null, + CheckInId = null, + }; + } } else {