Esempio n. 1
0
        private void btnFileSelect_Click(object sender, EventArgs e)
        {
            DialogResult result = dlgFileBrowser.ShowDialog();

            if (result == DialogResult.OK)
            {
                txtFileName.Text = dlgFileBrowser.FileName;
            }
            else
            {
                Logger.LogWarning("Error choosing file");
            }
        }
Esempio n. 2
0
 public static bool TestDBConnection(DBConnectionDetails DBConnection, LogHandler Logger)
 {
     if (Logger.DebugMode)
     {
         Logger.LogTrace("Enter TestDBConnection Method");
     }
     if (DBConnection.DBType == SupportedDatabases.PostgreSQL)
     {
         try
         {
             DatabaseUtils.Postgres.ConnectToPostGRES(DBConnection);
             if (Logger.DebugMode)
             {
                 Logger.LogDebug("Successful Connection to database");
             }
             return(true);
         }
         catch (Exception ex)
         {
             Logger.LogWarning("Unable to connect to database: " + ex.Message);
             return(false);
         }
     }
     return(true);
 }