/// <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; } }
/// <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); }