コード例 #1
0
 public int AddPerformance(PerformanceReview performance)
 {
     try
     {
         db.PerformanceReview.Add(performance);
         db.SaveChanges();
         return(1);
     }
     catch
     {
     }
     return(0);
 }
コード例 #2
0
 public int UpdatePerformance(PerformanceReview p)
 {
     try
     {
         //db.Entry(p).State = EntityState.Modified;
         db.Entry(p).Property(prop => prop.Performance).IsModified = true;
         db.Entry(p).Property(prop => prop.IsReviewed).IsModified  = true;
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }