Example #1
0
        public Object SaveAttendance(List <AttendanceHistoryDTO> history)
        {
            //Check this
            //List<AttendanceHistoryDTO> attHis = JsonConvert.DeserializeObject<List<AttendanceHistoryDTO>>(history);

            for (int i = 0; i < history.Count; i++)
            {
                AttendanceHistoryDTO ahd = history.ElementAt(i);
                AttendanceHistoryDAL.Save(ahd);

                AttendanceDTO atndnc = AttendanceDAO.GetAttendanceById(ahd.AttId);
                if (ahd.HisIsPresent)
                {
                    atndnc.AttPresents++;
                }
                else
                {
                    atndnc.AttAbsents++;
                }
                AttendanceDAO.Save(atndnc);
            }

            var IsSaved = true;

            return(IsSaved);
        }
Example #2
0
        public AttendanceDTO Save(AttendanceDTO dto)
        {
            AttendanceDAO b = new AttendanceDAO();

            dto = b.Save(dto);

            return(dto);
        }