Exemplo n.º 1
0
 public bool SaveChanges(System.Data.Objects.ObjectContext dataContext)
 {
     if (dataContext != null && this.TowarGuid != Guid.Empty)
     {
         if (this.EntityState == System.Data.EntityState.Detached)
         {
             dataContext.AddObject("Magazyn_StanyMagazynowe", this);
         }
         dataContext.SaveChanges();
         dataContext.Refresh(System.Data.Objects.RefreshMode.StoreWins, this);
         return(true);
     }
     if (this.EntityState == System.Data.EntityState.Added)
     {
         dataContext.DeleteObject(this);
     }
     return(false);
 }
Exemplo n.º 2
0
 //Commit all the pending changes in the data context
 public void Commit()
 {
     _service.SaveChanges();
 }