public void Save()
 {
     try
     {
         _db.Open(ConnectionStringPrimary, ConnectionStringSecondary);
         EngineList.ForEach(e =>
         {
             if (e.IsModified)
             {
                 if (e.Id == 0)
                 {
                     _db.DbInsertEngine(e);
                 }
                 else
                 {
                     _db.DbUpdateEngine(e);
                 }
             }
         });
         DeletedEngines.ForEach(s => { if (s.Id > 0)
                                       {
                                           _db.DbDeleteEngine(s);
                                       }
                                });
     }
     finally
     {
         _db.Close();
     }
 }
Exemple #2
0
 public void Save()
 {
     try
     {
         Database.Open(ConnectionStringPrimary, ConnectionStringSecondary);
         _engines.ForEach(e =>
         {
             if (e.IsModified)
             {
                 if (e.Id == 0)
                 {
                     e.DbInsertEngine();
                 }
                 else
                 {
                     e.DbUpdateEngine();
                 }
             }
         });
         DeletedEngines.ForEach(s => { if (s.Id > 0)
                                       {
                                           s.DbDeleteEngine();
                                       }
                                });
     }
     finally
     {
         Database.Close();
     }
 }
Exemple #3
0
 public void Save()
 {
     EngineList.ForEach(e =>
     {
         if (e.IsModified)
         {
             if (e.Id == 0)
             {
                 _db.InsertEngine(e);
             }
             else
             {
                 _db.UpdateEngine(e);
             }
         }
     });
     DeletedEngines.ForEach(s =>
     {
         if (s.Id > 0)
         {
             _db.DeleteEngine(s);
         }
     });
 }