예제 #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 = ProbationState.getInstance().GPAStateId;
     }
 }
예제 #2
0
        /// <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);
        }