public ActionResult DeleteConfirmed(int id) { if (_studentResultBusiness.GetAll().Any(x => x.StudentId == id) == false) { Student student = _studentBusiness.GetById((int)id); _studentBusiness.Delete(student); return(RedirectToAction("Index")); } else { TempData["message"] = "Delete The Student Result First"; return(RedirectToAction("Delete")); } }
public IActionResult DeleteConfirmed(int id) { Business.Delete(id); return(RedirectToAction(nameof(Index))); }
public ActionResult DeleteStudent(int studentid = 0) { _studentBusiness.Delete(studentid); return(RedirectToAction("Index", "Student")); }