Пример #1
0
 public bool Update(ProgramClassStudent obj)
 {
     try
     {
         _db.SubmitChanges();
     }
     catch (Exception ex)
     {
         Debug.Print(ex.Message);
         return(false);
     }
     return(true);
 }
Пример #2
0
 public int Add(ProgramClassStudent obj)
 {
     try
     {
         _db.ProgramClassStudents.InsertOnSubmit(obj);
         _db.SubmitChanges();
     }
     catch (Exception ex)
     {
         Debug.Print(ex.Message);
         return(-1);
     }
     return(_db.ProgramClassStudents.Max(x => x.ProgramClassStudentId));
 }