/// <summary> /// Checks to see if a student's state has changed. /// </summary> /// <param name="student"></param> public override void stateChangeCheck(Student student) { if (student.GradePointAverage >= UpperLimit) { student.GPAStateId = ProbationState.getInstance().GPAStateId; db.SaveChanges(); } }
/// <summary> /// Retrieves an instance of the ProbationState Class. /// </summary> /// <returns>Instance of ProbationState.</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); }