コード例 #1
0
 public IEnumerable<Grade> GetGradesOfPupil(Pupil pupil, Subject subject)
 {
     return (from grade in pupil.Grades
             where grade.SubjectArea.SubjectID == subject.ID
             orderby grade.SubjectArea.Name descending
             select grade);
 }
コード例 #2
0
 public void AddSubject(Subject subject)
 {
     entities.AddToSubjects(subject);
     entities.SaveChanges();
 }
コード例 #3
0
 public void AssignSubject(Teacher teacher, Subject subject, SchoolClass schoolClass)
 {
     entities.AddToTeacherSubjectAssignments(new TeacherSubjectAssignment() { Teacher = teacher, Subject = subject, SchoolClass = schoolClass});
     entities.SaveChanges();
 }
コード例 #4
0
 public void AssignVoluntarySubject(Pupil pupil, Subject subject)
 {
     entities.AddToVoluntarySubjectAssignements(new VoluntarySubjectAssignement() { Pupil = pupil, Subject = subject });
     entities.SaveChanges();
 }
コード例 #5
0
 public void AssignSubject(Branch branch, Subject subject, int level)
 {
     entities.AddToBranchSubjectAssignments(new BranchSubjectAssignment() { Branch = branch, Subject = subject, Level = level });
     entities.SaveChanges();
 }
コード例 #6
0
 public void AssignSPF(Pupil pupil, Subject subject, int level)
 {
     entities.AddToSPFs(new SPF() { Pupil = pupil, Subject = subject, Level = level });
     entities.SaveChanges();
 }
コード例 #7
0
 public void AssignSPF(Pupil pupil, Subject subject)
 {
     entities.AddToSPFs(new SPF() { Pupil = pupil, Subject = subject, Level = pupil.SchoolClass.Level });
     entities.SaveChanges();
 }
コード例 #8
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Subjects EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSubjects(Subject subject)
 {
     base.AddObject("Subjects", subject);
 }
コード例 #9
0
 /// <summary>
 /// Create a new Subject object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="isVoluntary">Initial value of the IsVoluntary property.</param>
 /// <param name="isBinding">Initial value of the IsBinding property.</param>
 public static Subject CreateSubject(global::System.Int32 id, global::System.String name, global::System.Boolean isVoluntary, global::System.Boolean isBinding)
 {
     Subject subject = new Subject();
     subject.ID = id;
     subject.Name = name;
     subject.IsVoluntary = isVoluntary;
     subject.IsBinding = isBinding;
     return subject;
 }