public void AddTeacher(Teacher teacher) { teacher.Courses = new List <Course>(); _teacherBll.AddTeacher(teacher); UpdateForm(); }
public ActionResult Create(TeacherModel tm) { if (tb.AddTeacher(tm)) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("Error", "添加教师失败!"); return(View()); } }