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 ActionResult DeleteConfirmed(int id) { if (_studentResultBusiness.GetAll().Any(x => x.CourseId == id) != true) { Course course = _courseBusiness.GetById((int)id); _courseBusiness.Delete(course); return(RedirectToAction("Index")); } else { // ViewBag.Message = "Result has assigned in this course"; TempData["message"] = "Result has assigned in this course"; return(RedirectToAction("Delete")); } //return View(); }
public ActionResult Index() { var studentResults = _studentResultBusiness.GetAll(); return(View(studentResults.ToList())); }