private static string GetServerInfo() { using (var scope = TypeContainer.BeginLifetimeScope()) { var dbs = scope.Resolve <IDataBaseService>(); var info = dbs.ServerInfo(); return($"{info.ServerName} ver. {info.ServerVersion}"); } }
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; } }