Esempio n. 1
0
        public Guid CreateAttendanceMachine(AttendanceMachineCreationDTO attendanceMachineCreationDTO)
        {
            AttendanceEvent attendanceMachine = new AttendanceEvent(
                attendanceMachineCreationDTO.AttendanceEvent,
                true);

            context.AttendanceEvents.Add(attendanceMachine);
            context.SaveChanges();
            return(attendanceMachine.Id);
        }
Esempio n. 2
0
        public void MarkAttendance(Guid machineId, MarkAttendanceDTO attendanceDTO)
        {
            /*
             * 1. Get the domain
             * 2. Let domain handle calls
             * 3. Persist the changes
             */
            AttendanceEvent attendanceMachine =
                context.AttendanceEvents.Find(machineId);

            attendanceMachine.Mark(attendanceDTO.PersonId, attendanceDTO.AttendanceEntry, attendanceDTO.Date);
            context.SaveChanges();
        }