/// <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 = ProbationState.getInstance().GPAStateId; } }
/// <summary> /// Gets Probation state instance. /// </summary> /// <returns>Probation state instance.</returns> public static ProbationState getInstance() { if (_probationState == null) { _probationState = db.ProbationStates.SingleOrDefault(); if (_probationState == null) { _probationState = new ProbationState(); db.ProbationStates.Add(_probationState); db.SaveChanges(); } } return(_probationState); }