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); }
public AttendanceDTO GetAttendanceById(int id) { AttendanceDTO dto = new AttendanceDTO(); AttendanceDAO d = new AttendanceDAO(); dto = d.GetAttendanceById(id); return(dto); }