public async Task <string> DeleteAttendance(int id)
        {
            try
            {
                var res = await _repository.DeleteAttendance(id);

                return(res);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void DeleteAttendance(int Id)
        {
            //var attendanceInDb = _context.Attendances.SingleOrDefault(a => a.AttendanceID == Id);

            //if (attendanceInDb == null)
            //{
            //    throw new HttpResponseException(HttpStatusCode.NotFound);
            //}

            //_context.Attendances.Remove(attendanceInDb);
            //_context.SaveChanges();
            _context.DeleteAttendance(Id);
        }
Beispiel #3
0
        public IActionResult DeleteAttendance(int id)
        {
            var attendance = _attendanceRepository.GetAttendance(id);
            var practiceID = attendance.PracticeID;

            _attendanceRepository.DeleteAttendance(attendance);
            var attendanceMembersViewModel = new AttendanceMembersViewModel
            {
                PracticeID = practiceID,
                Members    = _memberRepository.GetPracticeMemberList(practiceID).ToList()
            };

            return(PartialView("_Members", attendanceMembersViewModel));
        }
        public void DeleteData(Guid id)
        {
            var presence    = _repository.GetPresenceById(id);
            var studentList = _userRepo.GetAllUsers().Where(user => user.FactionId == id);

            foreach (var student in studentList)
            {
                var attendance = _attendance.GetAllAttendances().Where(attend => attend.UserId == student.Id).ToList();

                foreach (var attend in attendance)
                {
                    _attendance.DeleteAttendance(attend);
                }

                _userRepo.DeleteUser(student);
            }

            _repository.DeletePresence(presence);
        }
Beispiel #5
0
 public async Task <bool> DeleteAttendance(int attendanceId)
 {
     return(await _attendanceRepository.DeleteAttendance(attendanceId));
 }