/// <summary> /// Changes Student GradePointState from one state to another depending on the GradePointAverage. /// </summary> /// <param name="student">Student object</param> public override void StateChangeCheck(Student student) { // Does not need to check UpperLimit since HonoursState is the highest GradePointState possible. // Go to lower neighboring sibling: REGULARSTATE if (student.GradePointAverage < this.LowerLimit) { student.GradePointStateId = RegularState.GetInstance().GradePointStateId; } db.SaveChanges(); }
/// <summary> /// Changes Student GradePointState from one state to another depending on the GradePointAverage. /// </summary> /// <param name="student">Student object</param> public override void StateChangeCheck(Student student) { // Go to higher neighboring sibling: REGULARSTATE if (student.GradePointAverage > this.UpperLimit) { student.GradePointStateId = RegularState.GetInstance().GradePointStateId; } // Go to lower neighboring sibling: SUSPENDEDSTATE if (student.GradePointAverage < this.LowerLimit) { student.GradePointStateId = SuspendedState.GetInstance().GradePointStateId; } db.SaveChanges(); }