Ejemplo n.º 1
0
        public IActionResult DeleteStudentClass(int studentId, int classId)
        {
            var wasSucessful = _studentClassRepository.DeleteStudentClass(studentId, classId);

            if (wasSucessful)
            {
                return(Ok());
            }

            return(NotFound());
        }
Ejemplo n.º 2
0
        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());
        }