public ActionResult Delete(int id, Training training) { if (getCurrentUser() == null) { return(RedirectToAction("Index", "Login")); } else { try { itraining.Remove(id); return(RedirectToAction(nameof(Index))); } catch { return(View()); } } }