Example #1
0
        public void TestCheckInOut04()
        {
            var lastLog = new AttendanceLog("1", 15, 15, 2017, 12, 27, 10, 0, 0, 0, 1, "gate-01", DeviceType.InOut);

            lastLog.CheckIn();
            var currLog = new AttendanceLog("1", 15, 15, 2017, 12, 28, 8, 0, 0, 0, 1, "gate-01", DeviceType.InOut);
            var status  = currLog.CalculateStatus(lastLog);

            Assert.AreEqual(AttendanceStatus.CheckIn, status);
        }
Example #2
0
        private void CheckIn(AttendanceLog attendance, string workerId)
        {
            Logger.DebugFormat("Attendance({id}) CheckIn executes.", attendance.Id);
            attendance.CheckIn();

            Logger.Debug("SaveAttendanceLog executes.");
            SaveAttendanceLog(attendance);

            Logger.Debug("Bundle.CheckInToCTMS executes.");
            Bundle.CheckInToCTMS(attendance, workerId);
        }
Example #3
0
        private void EnsureCheckIn(AttendanceLog attendanceLog, string workerId)
        {
            attendanceLog.CheckIn();
            _db.AddAttendanceLog(attendanceLog);
            var ok = _web.CheckIn(attendanceLog.ProjectId, workerId, attendanceLog.LogDate,
                                  attendanceLog.DeviceName).GetAwaiter().GetResult();

            if (ok)
            {
                _db.UploadAttendanceLogSuccess(attendanceLog.Id);
            }
        }