internal Vacation Delete(int id) { Vacation original = Get(id); _repo.Delete(id); return(original); }
public async Task <IActionResult> DeleteConfirmed(string id, string returnUrl) { // if vacation was approved & personal add its days back Vacation vacation = await vacationRepository.GetByID(id); await IncrementUserVacationBalance(new VacationViewModel(vacation)); await vacationRepository.Delete(id); TempData["StatusMessage"] = "Vacation has been deleted successfully."; if (Url.IsLocalUrl(returnUrl)) { return(Redirect(returnUrl)); } return(RedirectToAction(nameof(Index))); }