Exemple #1
0
 private static string GetServerInfo()
 {
     using (var scope = TypeContainer.BeginLifetimeScope())
     {
         var dbs  = scope.Resolve <IDataBaseService>();
         var info = dbs.ServerInfo();
         return($"{info.ServerName} ver. {info.ServerVersion}");
     }
 }
Exemple #2
0
 static ConnectionState TestConnection()
 {
     try
     {
         using (var scope = TypeContainer.BeginLifetimeScope())
         {
             var dbs = scope.Resolve <IDataBaseService>();
             if (dbs.TestConnection())
             {
                 return(ConnectionState.Dostępne);
             }
         }
         return(ConnectionState.Niedostępne);
     }
     catch (Exception)
     {
         //MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
         //return false;
         throw;
     }
 }