Example #1
0
 public OutputBase DeleteAttendance(DeleteAttanceInput input)
 {
     _attendanceRepository.Delete(input.AttendanceId);
     return(new OutputBase {
         Message = "Attendance delete", Success = true
     });
 }
Example #2
0
        private void RemoveOldAttendanceEvents(Section section, DateTime date)
        {
            var existingAttendanceEvents = _attendanceRepository.GetSectionAttendanceEventsFor(section, date);

            if (!existingAttendanceEvents.IsNullOrEmpty())
            {
                foreach (var attendanceEvent in existingAttendanceEvents.Where(attendanceEvent => IsTardyOrUnexcused
                                                                                   (attendanceEvent.AttendanceEventCategoryDescriptorId)))
                {
                    DecrementFlagCount(attendanceEvent.Student);
                }

                _attendanceRepository.Delete(existingAttendanceEvents);
            }
        }
        public async Task <Response> Delete(int id)
        {
            Response response = new Response();

            try
            {
                response = await _repository.Delete(id);

                return(response);
            }
            catch (Exception e)
            {
                StringBuilder sb = new StringBuilder();
                log.Error(sb.AppendLine(e.Message).AppendLine(e.StackTrace).ToString());
                response.Success = false;
                response.ErrorList.Add("Erro while deleting Attendance");
                return(response);
            }
        }
Example #4
0
        public async Task <ActionResult <bool> > Delete(Guid attendanceid)
        {
            try
            {
                var attendancex = await _attendanceRepo.GetAttendanceWithID(attendanceid);

                if (attendancex == null)
                {
                    return(BadRequest($"could not find attendance with id: {attendanceid}"));
                }
                _attendanceRepo.Delete(attendancex);

                var result = await _attendanceRepo.SaveAll();

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, ex.InnerException.Message));
            }
        }
Example #5
0
 public void DeleteAttendance(AttendanceModel attendanceModel)
 {
     attendanceRepository.Delete(attendanceModel.ID);
 }
Example #6
0
 public void DeleteAttendance(int attendanceId)
 {
     attendanceRepository.Delete(attendanceRepository.GetById(attendanceId));
     attendanceRepository.Save();
 }
 public void DeleteAttendance(AttendanceModel attendanceModel)
 {
     _iAttendanceRepository.Delete(_iAttendanceMapper.Map(attendanceModel));
     _iAttendanceRepository.SaveChanges();
 }
 public Task Delete(int id)
 {
     return(_attendanceRepository.Delete(id));
 }