Solved time discrepancies in attendance/record #3
@ -219,6 +219,8 @@ namespace MarcoBMS.Services.Controllers
|
||||
Attendance attendance = await _context.Attendes.FirstOrDefaultAsync(a => a.EmployeeID == recordAttendanceDot.EmployeeID &&
|
||||
a.AttendanceDate.Date == recordAttendanceDot.Date.Date && a.TenantId == TenantId); ;
|
||||
|
||||
DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
||||
|
||||
|
||||
if (attendance != null)
|
||||
{
|
||||
@ -236,13 +238,13 @@ namespace MarcoBMS.Services.Controllers
|
||||
|
||||
//string timeString = "10:30 PM"; // Format: "hh:mm tt"
|
||||
|
||||
DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
||||
//DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
||||
|
||||
attendance.OutTime = finalDateTime;
|
||||
}
|
||||
else if (recordAttendanceDot.Action == ATTENDANCE_MARK_TYPE.REQUEST_REGULARIZE)
|
||||
{
|
||||
DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
||||
//DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
||||
|
||||
attendance.OutTime = finalDateTime;
|
||||
attendance.Activity = ATTENDANCE_MARK_TYPE.REQUEST_REGULARIZE;
|
||||
@ -277,7 +279,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
attendance.Date = DateTime.UtcNow;
|
||||
|
||||
|
||||
DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
||||
//DateTime finalDateTime = GetDateFromTimeStamp(recordAttendanceDot, recordAttendanceDot.MarkTime);
|
||||
|
||||
attendance.InTime = finalDateTime;
|
||||
attendance.OutTime = null;
|
||||
@ -295,7 +297,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
AttendanceId = attendance.Id, // Use existing or new AttendanceId
|
||||
Activity = attendance.Activity,
|
||||
|
||||
ActivityTime = recordAttendanceDot.Date,
|
||||
ActivityTime = finalDateTime,
|
||||
Comment = recordAttendanceDot.Comment,
|
||||
EmployeeID = recordAttendanceDot.EmployeeID,
|
||||
Latitude = recordAttendanceDot.Latitude,
|
||||
@ -303,7 +305,7 @@ namespace MarcoBMS.Services.Controllers
|
||||
|
||||
TenantId = TenantId,
|
||||
UpdatedBy = GetUserId(),
|
||||
UpdatedOn = DateTime.UtcNow
|
||||
UpdatedOn = recordAttendanceDot.Date
|
||||
};
|
||||
//if (recordAttendanceDot.Image != null && recordAttendanceDot.Image.Count > 0)
|
||||
//{
|
||||
|
Loading…
x
Reference in New Issue
Block a user