コード例 #1
0
 public ClassificationLevel GetClassificationlevelById(int ClassificationLevelId)
 {
     try
     {
         ClassificationLevel classificationLevel = db.ClassificationLevel.Find(ClassificationLevelId);
         return(classificationLevel);
     }
     catch
     {
         throw;
     }
 }
コード例 #2
0
 public int AddClassificationLevel(ClassificationLevel classificationLevel)
 {
     try
     {
         db.ClassificationLevel.Add(classificationLevel);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
コード例 #3
0
 //to delete ClassificationLevel
 public int DeleteClassificationLevel(int classificationLevelId)
 {
     try
     {
         ClassificationLevel classificationlevel = db.ClassificationLevel.Find(classificationLevelId);
         db.ClassificationLevel.Remove(classificationlevel);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
コード例 #4
0
        public int UpdateClassificationLevel(ClassificationLevel classificationLevel)
        {
            try
            {
                db.Entry(classificationLevel).State = EntityState.Modified;
                db.SaveChanges();

                return(1);
            }
            catch
            {
                throw;
            }
        }