private void CreateCatClassOrYearTableData()
 {
     foreach (string newClassOrYear in CatClassOrYear.GetCatagoryList())
     {
         ClassOrYear classOrYear = new ClassOrYear(newClassOrYear, newClassOrYear);
         classOrYear.Code = newClassOrYear;
         classOrYear.Name = newClassOrYear;
         SaveClassOrYear(classOrYear);
     }
 }
        private void SaveClassOrYear(ClassOrYear classOrYear)
        {
            ClassOrYear classyear = db.ClassOrYears.Find(classOrYear.Code);

            if (classyear == null)
            {
                db.ClassOrYears.Add(classOrYear);
                db.SaveChanges();
            }
        }