Пример #1
0
 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)));
 }
Пример #3
0
 public ActionResult DeleteStudent(int studentid = 0)
 {
     _studentBusiness.Delete(studentid);
     return(RedirectToAction("Index", "Student"));
 }