Esempio n. 1
0
 public override void stateChangeCheck(Student student)
 {
     if (student.GradePointAverage < LowerLimit)
     {
         student.GPAStateId = RegularState.getInstance().GPAStateId;
         student.changeState();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// gets an instance of RegularState and populates it if it is null
        /// </summary>
        /// <returns></returns>
        public static RegularState getInstance()
        {
            if (regularState == null)
            {
                if (context.RegularStates.SingleOrDefault() != null)
                {
                    regularState = context.RegularStates.SingleOrDefault();
                }
                else
                {
                    context.RegularStates.Add(new RegularState());
                    context.SaveChanges();
                }
            }

            return(regularState);
        }