Пример #1
0
 public void inserirConta(Conta c)
 {
     DataContext dc = getDataContext();
     Table<Conta> tc = dc.GetTable<Conta>();
     tc.InsertOnSubmit(c);
     dc.SubmitChanges();
 }
Пример #2
0
 public void alterarConta(Conta c)
 {
     DataContext dc = getDataContext();
     Table<Conta> tc = dc.GetTable<Conta>();
     tc.Attach(c, true);
     try
     {
         dc.SubmitChanges(ConflictMode.ContinueOnConflict);
     }
     //catch (ChangeConflictException e)
     catch (ChangeConflictException)
     {
         dc.ChangeConflicts.ResolveAll(RefreshMode.KeepCurrentValues); // last -in - wins
         dc.SubmitChanges();
     }
 }