예제 #1
0
        public IActionResult Delete(int volunteerId)
        {
            Volunteer deletedVolunteer = repository.DeleteVolunteer(volunteerId);

            if (deletedVolunteer != null)
            {
                TempData["message"] = $"{deletedVolunteer.LastName} was deleted";
            }
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public void DeleteVolunteer(VolunteerDTO dto)
        {
            try
            {
                log.Debug(VolunteerDTO.FormatVolunteerDTO(dto));

                R_Volunteer t = VolunteerDTO.ConvertDTOtoEntity(dto);

                // delete
                Repository.DeleteVolunteer(t);
                dto.IsDeleted = t.IsDeleted;

                log.Debug("result: 'success'");
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }
        }
예제 #3
0
 public IActionResult DeleteVolunteer(int id)
 {
     _volunteerRepository.DeleteVolunteer(id);
     return(RedirectToAction("VolunteerList"));
 }