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

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

            return(RedirectToPage());
        }
Beispiel #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));
 }
Beispiel #3
0
 public IActionResult DeleteVacancy(int vacancyId)
 {
     _vacancyService.DeleteVacancy(vacancyId);
     return(Ok());
 }