예제 #1
0
 /// <summary>
 /// Checks the GPA state change.
 /// </summary>
 /// <param name="student">A student.</param>
 public override void stateChangeCheck(Student student)
 {
     if (student.GradePointAverage > getInstance().UpperLimit)
     {
         student.GPAStateId = HonoursState.getInstance().GPAStateId;
     }
     else if (student.GradePointAverage < getInstance().LowerLimit)
     {
         student.GPAStateId = ProbationState.getInstance().GPAStateId;
     }
 }
예제 #2
0
        /// <summary>
        /// Gets Honours state instance.
        /// </summary>
        /// <returns>Honours state instance.</returns>
        public static HonoursState getInstance()
        {
            if (_honoursState == null)
            {
                _honoursState = db.HonoursStates.SingleOrDefault();
                if (_honoursState == null)
                {
                    _honoursState = new HonoursState();
                    db.HonoursStates.Add(_honoursState);
                    db.SaveChanges();
                }
            }

            return(_honoursState);
        }