/// <summary> /// 添加班级 /// </summary> /// <param name="cls">班级</param> /// <returns></returns> public bool AddClass(Class cls) { _db.Classes.Add(cls); var result = _db.SaveChanges(); return(result > 0); }
/// <summary> /// 添加答案 /// </summary> /// <param name="answer">科目</param> /// <returns></returns> public bool AddAnswer(Answer answer) { db.Answers.Add(answer); var result = db.SaveChanges(); return(result > 0); }
/// <summary> /// 添加教师 /// </summary> /// <param name="teacher">教师</param> /// <returns></returns> public bool AddTeacher(Teacher teacher) { db.Teachers.Add(teacher); var result = db.SaveChanges(); return(result > 0); }
/// <summary> /// 添加考试 /// </summary> /// <param name="test">考试</param> /// <returns></returns> public bool AddTest(Test test) { db.Tests.Add(test); var result = db.SaveChanges(); return(result > 0); }
/// <summary> /// 添加题目 /// </summary> /// <param name="question">题目</param> /// <returns></returns> public bool AddQuestion(Questions question) { db.Questions.Add(question); var result = db.SaveChanges(); return(result > 0); }
/// <summary> /// 添加考试班级 /// </summary> /// <param name="clsTest">考试班级</param> /// <returns></returns> public bool AddClassTest(ClassTest clsTest) { _db.ClassTests.Add(clsTest); var result = _db.SaveChanges(); return(result > 0); }
/// <summary> /// 添加学生 /// </summary> /// <param name="student">学生</param> /// <returns></returns> public bool AddStudent(Student student) { _db.Students.Add(student); var result = _db.SaveChanges(); return(result > 0); }
/// <summary> /// 添加科目 /// </summary> /// <param name="subject">科目</param> /// <returns></returns> public bool AddSubject(Subjects subject) { db.Subjects.Add(subject); var result = db.SaveChanges(); return(result > 0); }