public ActionResult DeleteTeacher(int id)
        {
            TeacherDataController controller = new TeacherDataController();

            controller.DeleteTeacher(id);
            return(RedirectToAction("Filter"));
        }
Beispiel #2
0
        public ActionResult Delete(int teacherId, int classCount)
        {
            TeacherDataController controller = new TeacherDataController();

            // Delete teacher
            controller.DeleteTeacher(teacherId);
            // if deleted teacher has classes associated, remove them
            if (classCount > 0)
            {
                controller.RemoveTeacherClasses(teacherId);
            }
            return(RedirectToAction("List"));
        }