Exemplo n.º 1
0
        /// <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: PROBATIONSTATE
            if (student.GradePointAverage > this.UpperLimit)
            {
                student.GradePointStateId = ProbationState.GetInstance().GradePointStateId;

                db.SaveChanges();
            }

            // Does not need to check lower limit since SuspendedState is the lowest state possible.
        }
Exemplo n.º 2
0
        /// <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: HONOURSSTATE
            if (student.GradePointAverage > this.UpperLimit)
            {
                student.GradePointStateId = HonoursState.GetInstance().GradePointStateId;
            }

            // Go to lower neighboring sibling: PROBATIONSTATE
            if (student.GradePointAverage < this.LowerLimit)
            {
                student.GradePointStateId = ProbationState.GetInstance().GradePointStateId;
            }

            db.SaveChanges();
        }