示例#1
0
 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();
     }
 }
示例#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();
     }
 }
示例#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);
         }
     });
 }