public void TestCheckInOut05() { var lastLog = new AttendanceLog("1", 15, 15, 2017, 12, 27, 18, 0, 0, 0, 1, "gate-01", DeviceType.InOut); lastLog.CheckOut(); var currLog = new AttendanceLog("1", 15, 15, 2017, 12, 28, 7, 0, 0, 0, 1, "gate-01", DeviceType.InOut); var status = currLog.CalculateStatus(lastLog); Assert.AreEqual(AttendanceStatus.CheckIn, status); }
private void CheckOut(AttendanceLog attendance, string workerId) { Logger.DebugFormat("Attendance({id}) CheckOut executes.", attendance.Id); attendance.CheckOut(); Logger.Debug("SaveAttendanceLog executes."); SaveAttendanceLog(attendance); Logger.Debug("Bundle.CheckOutToCTMS executes."); Bundle.CheckOutToCTMS(attendance, workerId); }
private void EnsureCheckOut(AttendanceLog attendanceLog, string workerId) { attendanceLog.CheckOut(); _db.AddAttendanceLog(attendanceLog); var ok = _web.CheckOut(attendanceLog.ProjectId, workerId, attendanceLog.LogDate) .GetAwaiter().GetResult(); if (ok) { _db.UploadAttendanceLogSuccess(attendanceLog.Id); } }