public void Save()
 {
     try
     {
         Database.Open(_connectionString, _connectionStringSecondary);
         _servers.ForEach(s =>
         {
             if (s.Id == 0)
             {
                 s.DbInsertServer();
             }
             else
             {
                 s.DbUpdateServer();
             }
         });
         DeletedServers.ForEach(s => { if (s.Id > 0)
                                       {
                                           s.DbDeleteServer();
                                       }
                                });
     }
     finally
     {
         Database.Close();
     }
 }
Beispiel #2
0
 public void Save()
 {
     Servers.ForEach(s =>
     {
         if (s.Id == 0)
         {
             _db.InsertServer(s);
         }
         else
         {
             _db.UpdateServer(s);
         }
     });
     DeletedServers.ForEach(s => { if (s.Id > 0)
                                   {
                                       _db.DeleteServer(s);
                                   }
                            });
 }