public IActionResult DeleteStudentClass(int studentId, int classId) { var wasSucessful = _studentClassRepository.DeleteStudentClass(studentId, classId); if (wasSucessful) { return(Ok()); } return(NotFound()); }
public async Task <IActionResult> deleteStudentClass(int StudentClass_Id) { if (ModelState.IsValid) { int result = await _StudentClassRepository.DeleteStudentClass(StudentClass_Id); if (result == 1) { TempData["Success"] = "Student Class Delete Successfully"; return(RedirectToAction("studentClassDetail", "Student", new { area = "admin" })); } else { TempData["Error"] = "Failed To Delete Student Class"; return(RedirectToAction("studentClassDetail", "Student", new { area = "admin" })); } } return(View()); }