예제 #1
0
        public async Task <IActionResult> OnPostDeleteAsync(int id)
        {
            var vacancy = await _vacancyService.FindVacancy(id);

            if (vacancy != null)
            {
                await _vacancyService.DeleteVacancy(id);
            }

            return(RedirectToPage());
        }
예제 #2
0
 public ActionResult Delete(int id, VacancyViewModel viewModel)
 {
     try
     {
         vacancyService.DeleteVacancy(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         ModelState.AddModelError("", "An error has occured. This Employee was not deleted.");
     }
     return(View(viewModel));
 }
예제 #3
0
 public IActionResult DeleteVacancy(int vacancyId)
 {
     _vacancyService.DeleteVacancy(vacancyId);
     return(Ok());
 }