예제 #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 inserirConta(Conta c)
 {
     DataContext dc = new DataContext(@"Data Source=MIRANDA-LAPTOP\SQL2012DEINST1;Initial Catalog=ASI;Integrated Security=true");//TODO: CONFIGURATION FILE!
     Table<Conta> tc = dc.GetTable<Conta>();
     tc.InsertOnSubmit(c);
     dc.SubmitChanges();
 }
예제 #3
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)
     {
         dc.ChangeConflicts.ResolveAll(RefreshMode.KeepCurrentValues); // last -in - wins
         dc.SubmitChanges();
     }
 }
예제 #4
0
 public void alterarConta(Conta c)
 {
     DataContext dc = new DataContext(@"Data Source=MIRANDA-LAPTOP\SQL2012DEINST1;Initial Catalog=ASI;Integrated Security=true");//TODO: CONFIGURATION FILE!
     Table<Conta> tc = dc.GetTable<Conta>();
     tc.Attach(c, true);
     try
     {
         dc.SubmitChanges(ConflictMode.ContinueOnConflict);
     }
     catch (ChangeConflictException e)
     {
         dc.ChangeConflicts.ResolveAll(RefreshMode.KeepCurrentValues); // last -in - wins
         dc.SubmitChanges();
     }
 }