public ActionResult EditTeacher(int id) { USERLOGIN user = TeacherActions.findTeacherByID(id); ViewBag.listParishes = ParishActions.listParishes(); ViewBag.StudentByID = user; ViewBag.ListClassByTeacherID = ClassActions.findListClassByTeacherID(id); var liststudent_byclassid = StudentActions.findListStudentByClassID(id); if (liststudent_byclassid == null) { ViewBag.ListStudentByClassID = null; } else { ViewBag.ListStudentByClassID = liststudent_byclassid; } return(View(ParishActions.findParishByUserID(user.userid))); }