コード例 #1
0
ファイル: FormFeeScheds.cs プロジェクト: ChemBrain/OpenDental
        private void butHideUnused_Click(object sender, EventArgs e)
        {
            if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Hide fee schedules that are not in use by insurance plans, patients, or providers?\r\n"
                             + "A backup of the database will be made first."))
            {
                return;
            }
            bool   hasChanged     = FeeScheds.Sync(_listFeeScheds, _listFeeSchedsOld);
            Action actionProgress = ODProgress.Show(ODEventType.HideUnusedFeeSchedules, startingMessage: Lans.g(this, "Backing up database..."));

            try {
                MiscData.MakeABackup();
            }
            catch (Exception ex) {
                actionProgress?.Invoke();
                FriendlyException.Show(Lans.g(this, "Unable to make a backup. No fee schedules have been altered."), ex);
                return;
            }
            ODEvent.Fire(ODEventType.HideUnusedFeeSchedules, Lans.g(this, "Hiding unused fee schedules..."));
            long countChanged = FeeScheds.HideUnusedScheds();

            if (hasChanged || countChanged > 0)
            {
                DataValid.SetInvalid(InvalidType.FeeScheds);
            }
            actionProgress?.Invoke();
            MessageBox.Show(countChanged.ToString() + " " + Lans.g(this, "unused fee schedules hidden."));
            _listFeeScheds    = FeeScheds.GetDeepCopy(_isSelectionMode);
            _listFeeSchedsOld = _listFeeScheds.Select(x => x.Copy()).ToList();
            FillGrid();
        }
コード例 #2
0
ファイル: PrefL.cs プロジェクト: nampn/ODental
        ///<summary>This ONLY runs when first opening the program.  Gets run early in the sequence. Returns false if the program should exit.</summary>
        public static bool CheckMySqlVersion()
        {
            if (DataConnection.DBtype != DatabaseType.MySql)
            {
                return(true);
            }
            string thisVersion  = MiscData.GetMySqlVersion();
            float  floatVersion = PIn.Float(thisVersion.Substring(0, 3));

            if (floatVersion < 5.0f)
            {
                //We will force users to upgrade to 5.0, but not yet to 5.5
                MessageBox.Show(Lan.g("Prefs", "Your version of MySQL won't work with this program") + ": " + thisVersion
                                + ".  " + Lan.g("Prefs", "You should upgrade to MySQL 5.0 using the installer on our website."));
                Application.Exit();
                return(false);
            }
            if (!PrefC.ContainsKey("MySqlVersion"))             //db has not yet been updated to store this pref
            //We're going to skip this.  We will recommend that people first upgrade OD, then MySQL, so this won't be an issue.
            {
            }
            else if (Prefs.UpdateString(PrefName.MySqlVersion, floatVersion.ToString("f1")))
            {
                if (!MsgBox.Show("Prefs", MsgBoxButtons.OKCancel, "Tables will now be optimized.  This will take a minute or two."))
                {
                    Application.Exit();
                    return(false);
                }
                DatabaseMaintenance.RepairAndOptimize();
            }
            if (PrefC.ContainsKey("DatabaseConvertedForMySql41"))
            {
                return(true);               //already converted
            }
            if (!MsgBox.Show("Prefs", true, "Your database will now be converted for use with MySQL 4.1."))
            {
                Application.Exit();
                return(false);
            }
            //ClassConvertDatabase CCD=new ClassConvertDatabase();
            try {
                MiscData.MakeABackup();
            }
            catch (Exception e) {
                if (e.Message != "")
                {
                    MessageBox.Show(e.Message);
                }
                MsgBox.Show("Prefs", "Backup failed. Your database has not been altered.");
                Application.Exit();
                return(false);               //but this should never happen
            }
            MessageBox.Show("Backup performed");
            Prefs.ConvertToMySqlVersion41();
            MessageBox.Show("converted");
            //Refresh();
            return(true);
        }
コード例 #3
0
        /// <summary>Will only convert to InnoDB if default storage engine set to InnoDB and skip-innodb is not in my.ini file, which disables InnoDB engine.</summary>
        private void butToInnoDb_Click(object sender, EventArgs e)
        {
            if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "This will convert all tables in the database to the InnoDB storage engine.  This may take several minutes.\r\nContinue?"))
            {
                return;
            }
            if (!InnoDb.IsInnodbAvail())
            {
                MsgBoxCopyPaste msgbox = new MsgBoxCopyPaste(
                    Lan.g("FormInnoDb", "InnoDB storage engine is disabled.  In order for InnoDB tables to work you must comment out the skip-innodb line in your my.ini file, like this:\r\n"
                          + "#skip-innodb\r\n"
                          + "and, if present, comment out the default-storage-engine line like this: \r\n"
                          + "#default-storage-engine=MyISAM.\r\n"
                          + "Then, restart the MySQL service and return here."));
                msgbox.ShowDialog();
                return;
            }
            if (InnoDb.GetDefaultEngine() == "MyISAM")
            {
                MsgBoxCopyPaste msgbox = new MsgBoxCopyPaste(
                    Lan.g("FormInnoDB", "You will first need to change your default storage engine to InnoDB.  In your my.ini file, comment out the default-storage-engine line like this: \r\n"
                          + "#default-storage-engine=MyISAM.\r\n"
                          + "Then, restart the MySQL service and return here."));
                msgbox.ShowDialog();
                return;
            }
            try {
                MiscData.MakeABackup();
            }
            catch (Exception ex) {
                if (ex.Message != "")
                {
                    MessageBox.Show(ex.Message);
                }
                MsgBox.Show("FormInnoDb", "Backup failed. Your database has not been altered.");
                return;
            }
            Cursor         = Cursors.WaitCursor;
            textBox1.Text += Lans.g("FormInnoDb", "Default Storage Engine: " + InnoDb.GetDefaultEngine().ToString() + "\r\n");
            Application.DoEvents();
            int numchanged = InnoDb.ConvertTables("MyISAM", "InnoDB");

            textBox1.Text += Lan.g("FormInnoDb", "Number of tables converted to InnoDB: ") + numchanged.ToString() + "\r\n";
            Application.DoEvents();
            textBox1.Text += InnoDb.GetEngineCount();
            Application.DoEvents();
            Cursor = Cursors.Default;
        }
コード例 #4
0
 private void butArchive_Click(object sender, EventArgs e)
 {
     #region Validation
     if (checkArchiveDoBackupFirst.Checked)              //We only need to validate the backup settings if the user wants to make a backup first
     {
         if (!MsgBox.Show(MsgBoxButtons.YesNo, "To make a backup of the database, ensure no other machines are currently using OpenDental. Proceed?"))
         {
             return;
         }
         //Validation
         if (string.IsNullOrWhiteSpace(textArchiveServerName.Text))
         {
             MsgBox.Show(this, "Please specify a Server Name.");
             return;
         }
         if (string.IsNullOrWhiteSpace(textArchiveUser.Text))
         {
             MsgBox.Show(this, "Please enter a User.");
             return;
         }
         if (string.IsNullOrWhiteSpace(PrefC.GetString(PrefName.ArchiveKey)))                 //If archive key isn't set, generate a new one.
         {
             string archiveKey = MiscUtils.CreateRandomAlphaNumericString(10);
             Prefs.UpdateString(PrefName.ArchiveKey, archiveKey);
         }
     }
     #endregion
     //Create an ODProgress
     ODProgress.ShowAction(() => {
         //Make a backup if needed
         if (checkArchiveDoBackupFirst.Checked)
         {
             try {
                 MiscData.MakeABackup(textArchiveServerName.Text, textArchiveUser.Text, textArchivePass.Text, doVerify: true);
             }
             catch (Exception ex) {
                 FriendlyException.Show("An error occurred backing up the old database. Old data was not removed from the database. " +
                                        "Ensure no other machines are currently using OpenDental and try again.", ex);
                 return;
             }
         }
         //Delete the unnecessary data
         SecurityLogs.DeleteBeforeDateInclusive(dateTimeArchive.Value);
         SecurityLogs.MakeLogEntry(Permissions.Backup, 0, $"SecurityLog and SecurityLogHashes on/before {dateTimeArchive.Value} deleted.");
     },
                           eventType: typeof(MiscDataEvent),
                           odEventType: ODEventType.MiscData);
 }
コード例 #5
0
ファイル: ClassesShared.cs プロジェクト: kjb7749/testImport
        ///<summary>This is a wrapper method for MiscData.MakeABackup() that will show a progress window so that the user can see progress.
        ///Set isSilent to true to suppress the failure message boxes.  However, the progress window will always be shown.
        ///Returns false if making a backup failed.</summary>
        public static bool MakeABackup(bool isSilent, BackupLocation backupLocation, bool isSecurityLogged = true)
        {
            if (DataConnection.DBtype == DatabaseType.Oracle)
            {
                return(false);               //Because MiscData.MakeABackup() is not yet Oracle compatible.
            }
#if DEBUG
            switch (MessageBox.Show("Would you like to make a backup of the DB?", "DEBUG ONLY", MessageBoxButtons.YesNoCancel))
            {
            case DialogResult.Cancel:
                return(false);

            case DialogResult.No:
                return(true);

            case DialogResult.Yes:
            default:
                //do nothing, make backup like usual.
                break;
            }
#endif
            //Create a thread that will show a window and then stay open until the closing action is called.
            Action actionCloseBackupProgress = ODProgressOld.ShowProgressStatus("BackupProgress", null);
            try {
                MiscData.MakeABackup();
                actionCloseBackupProgress(); //Close the progress window.
            }
            catch (Exception ex) {           //MiscData.MakeABackup() could have thrown an exception.
                actionCloseBackupProgress(); //Close the progress window.
                //Show the user that something what went wrong when not in silent mode.
                if (!isSilent)
                {
                    if (ex.Message != "")
                    {
                        MessageBox.Show(ex.Message);
                    }
                    //Reusing translation in ClassConvertDatabase, since it is most likely the only place a translation would have been performed previously.
                    MsgBox.Show("ClassConvertDatabase", "Backup failed. Your database has not been altered.");
                }
                return(false);
            }
            if (isSecurityLogged && PrefC.GetStringNoCache(PrefName.UpdateStreamLinePassword) != "abracadabra")
            {
                SecurityLogs.MakeLogEntryNoCache(Permissions.Backup, 0, Lan.g("Backups", "A backup was created when running the") + " " + backupLocation.ToString());
            }
            return(true);
        }
コード例 #6
0
 private void butBackup_Click(object sender, EventArgs e)
 {
     Cursor = Cursors.WaitCursor;
                 #if !DEBUG
     MiscData.MakeABackup();
                 #endif
     //backupMade=true;
     if (duplicateClaimProcInfo != "")
     {
         butFix1.Enabled = true;
     }
     if (duplicateSuppInfo != "")
     {
         butFix2.Enabled = true;
     }
     if (missingSuppInfo != "")
     {
         butFix3.Enabled = true;
     }
     Cursor = Cursors.Default;
 }
コード例 #7
0
ファイル: Prefs.cs プロジェクト: luisurbinanet/gnudental
        ///<summary>This ONLY runs when first opening the program.  Gets run early in the sequence. Returns false if the program should exit.</summary>
        public static bool CheckMySqlVersion41()
        {
            if (FormChooseDatabase.DBtype != DatabaseType.MySql)
            {
                return(true);
            }
            string    command     = "SELECT @@version";
            DataTable table       = General.GetTable(command);
            string    thisVersion = PIn.PString(table.Rows[0][0].ToString());

            //if(thisVersion.Substring(0,3)=="4.0"){
            //do nothing
            //}
            if (thisVersion.Substring(0, 3) == "4.1" ||
                thisVersion.Substring(0, 3) == "5.0" ||
                thisVersion.Substring(0, 3) == "5.1")
            {
                if (PrefB.HList.ContainsKey("DatabaseConvertedForMySql41"))
                //&& GetBool("DatabaseConvertedForMySql41"))
                {
                    return(true);                   //already converted
                }
                if (!MsgBox.Show("Prefs", true, "Your database will now be converted for use with MySQL 4.1."))
                {
                    Application.Exit();
                    return(false);
                }
                //ClassConvertDatabase CCD=new ClassConvertDatabase();
                try {
                    MiscData.MakeABackup();
                }
                catch (Exception e) {
                    if (e.Message != "")
                    {
                        MessageBox.Show(e.Message);
                    }
                    MsgBox.Show("Prefs", "Backup failed. Your database has not been altered.");
                    Application.Exit();
                    return(false);                   //but this should never happen
                }
                MessageBox.Show("Backup performed");
                command = "SHOW TABLES";
                table   = General.GetTable(command);
                string[] tableNames = new string[table.Rows.Count];
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    tableNames[i] = table.Rows[i][0].ToString();
                }
                for (int i = 0; i < tableNames.Length; i++)
                {
                    if (tableNames[i] != "procedurecode")
                    {
                        command = "ALTER TABLE " + tableNames[i] + " CONVERT TO CHARACTER SET utf8";
                        General.NonQ(command);
                    }
                }
                string[] commands = new string[]
                {
                    "ALTER TABLE procedurecode CHANGE ADACode ADACode varchar(15) character set utf8 collate utf8_bin NOT NULL"
                    , "ALTER TABLE procedurecode DEFAULT character set utf8"
                    , "ALTER TABLE procedurecode MODIFY Descript varchar(255) character set utf8 NOT NULL"
                    , "ALTER TABLE procedurecode MODIFY AbbrDesc varchar(50) character set utf8 NOT NULL"
                    , "ALTER TABLE procedurecode MODIFY ProcTime varchar(24) character set utf8 NOT NULL"
                    , "ALTER TABLE procedurecode MODIFY DefaultNote text character set utf8 NOT NULL"
                    , "ALTER TABLE procedurecode MODIFY AlternateCode1 varchar(15) character set utf8 NOT NULL"
                    , "ALTER TABLE procedurelog MODIFY ADACode varchar(15) character set utf8 collate utf8_bin NOT NULL"
                    , "ALTER TABLE autocodeitem MODIFY ADACode varchar(15) character set utf8 collate utf8_bin NOT NULL"
                    , "ALTER TABLE procbuttonitem MODIFY ADACode varchar(15) character set utf8 collate utf8_bin NOT NULL"
                    , "ALTER TABLE covspan MODIFY FromCode varchar(15) character set utf8 collate utf8_bin NOT NULL"
                    , "ALTER TABLE covspan MODIFY ToCode varchar(15) character set utf8 collate utf8_bin NOT NULL"
                    , "ALTER TABLE fee MODIFY ADACode varchar(15) character set utf8 collate utf8_bin NOT NULL"
                };
                General.NonQ(commands);
                //and set the default too
                command = "ALTER DATABASE CHARACTER SET utf8";
                General.NonQ(command);
                command = "INSERT INTO preference VALUES('DatabaseConvertedForMySql41','1')";
                General.NonQ(command);
                MessageBox.Show("converted");
                //Refresh();
            }
            else
            {
                MessageBox.Show(Lan.g("Prefs", "Your version of MySQL won't work with this program") + ": " + thisVersion
                                + ".  " + Lan.g("Prefs", "You should upgrade to MySQL 4.1"));
                Application.Exit();
                return(false);
            }
            return(true);
        }
コード例 #8
0
ファイル: ClassConvertDatabase.cs プロジェクト: nampn/ODental
        ///<summary>Return false to indicate exit app.  Only called when program first starts up at the beginning of FormOpenDental.PrefsStartup.</summary>
        public bool Convert(string fromVersion, string toVersion, bool silent)
        {
            FromVersion = new Version(fromVersion);
            ToVersion   = new Version(toVersion);        //Application.ProductVersion);
            if (FromVersion == ToVersion)
            {
                return(true);               //no conversion necessary
            }
            if (FromVersion >= new Version("3.4.0") && PrefC.GetBool(PrefName.CorruptedDatabase))
            {
                MsgBox.Show(this, "Your database is corrupted because a conversion failed.  Please contact us.  This database is unusable and you will need to restore from a backup.");
                return(false);                        //shuts program down.
            }
            if (FromVersion.CompareTo(ToVersion) > 0) //"Cannot convert database to an older version."
            //no longer necessary to catch it here.  It will be handled soon enough in CheckProgramVersion
            {
                return(true);
            }
            if (FromVersion < new Version("2.8.0"))
            {
                MsgBox.Show(this, "This database is too old to easily convert in one step. Please upgrade to 2.1 if necessary, then to 2.8.  Then you will be able to upgrade to this version. We apologize for the inconvenience.");
                return(false);
            }
            if (FromVersion < new Version("6.6.2"))
            {
                MsgBox.Show(this, "This database is too old to easily convert in one step. Please upgrade to 11.1 first.  Then you will be able to upgrade to this version. We apologize for the inconvenience.");
                return(false);
            }
            if (FromVersion < new Version("3.0.1"))
            {
                MsgBox.Show(this, "This is an old database.  The conversion must be done using MySQL 4.1 (not MySQL 5.0) or it will fail.");
            }
            if (FromVersion.ToString() == "2.9.0.0" || FromVersion.ToString() == "3.0.0.0" || FromVersion.ToString() == "4.7.0.0")
            {
                MsgBox.Show(this, "Cannot convert this database version which was only for development purposes.");
                return(false);
            }
            if (FromVersion > new Version("4.7.0") && FromVersion.Build == 0)
            {
                MsgBox.Show(this, "Cannot convert this database version which was only for development purposes.");
                return(false);
            }
            if (FromVersion >= ConvertDatabases.LatestVersion)
            {
                return(true);               //no conversion necessary
            }
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                MsgBox.Show(this, "Web client cannot convert database.  Must be using a direct connection.");
                return(false);
            }
            if (ReplicationServers.ServerIsBlocked())
            {
                MsgBox.Show(this, "This replication server is blocked from performing updates.");
                return(false);
            }
            if (PrefC.GetString(PrefName.WebServiceServerName) != "" &&       //using web service
                !ODEnvironment.IdIsThisComputer(PrefC.GetString(PrefName.WebServiceServerName).ToLower()))                   //and not on web server
            {
                MessageBox.Show(Lan.g(this, "Updates are only allowed from the web server: ") + PrefC.GetString(PrefName.WebServiceServerName));
                return(false);
            }
            //If MyISAM and InnoDb mix, then try to fix
            if (DataConnection.DBtype == DatabaseType.MySql)                    //not for Oracle
            {
                string namesInnodb = DatabaseMaintenance.GetInnodbTableNames(); //Or possibly some other format.
                int    numMyisam   = DatabaseMaintenance.GetMyisamTableCount();
                if (namesInnodb != "" && numMyisam > 0)
                {
                    MessageBox.Show(Lan.g(this, "A mixture of database tables in InnoDB and MyISAM format were found.  A database backup will now be made, and then the following InnoDB tables will be converted to MyISAM format: ") + namesInnodb);
                    try {
                        MiscData.MakeABackup();                        //Does not work for Oracle, due to some MySQL specific commands inside.
                    }
                    catch (Exception e) {
                        Cursor.Current = Cursors.Default;
                        if (e.Message != "")
                        {
                            MessageBox.Show(e.Message);
                        }
                        MsgBox.Show(this, "Backup failed. Your database has not been altered.");
                        return(false);
                    }
                    if (!DatabaseMaintenance.ConvertTablesToMyisam())
                    {
                        MessageBox.Show(Lan.g(this, "Failed to convert InnoDB tables to MyISAM format. Please contact support."));
                        return(false);
                    }
                    MessageBox.Show(Lan.g(this, "All tables converted to MyISAM format successfully."));
                    namesInnodb = "";
                }
                if (namesInnodb == "" && numMyisam > 0)             //if all tables are myisam
                //but default storage engine is innodb, then kick them out.
                {
                    if (DatabaseMaintenance.GetStorageEngineDefaultName().ToUpper() != "MYISAM")                    //Probably InnoDB but could be another format.
                    {
                        MessageBox.Show(Lan.g(this, "The database tables are in MyISAM format, but the default database engine format is InnoDB. You must change the default storage engine within the my.ini (or my.cnf) file on the database server and restart MySQL in order to fix this problem. Exiting."));
                        return(false);
                    }
                }
            }
#if DEBUG
            if (!silent && MessageBox.Show("You are in Debug mode.  Your database can now be converted" + "\r"
                                           + "from version" + " " + FromVersion.ToString() + "\r"
                                           + "to version" + " " + ToVersion.ToString() + "\r"
                                           + "You can click Cancel to skip conversion and attempt to the newer code against the older database."
                                           , "", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return(true);               //If user clicks cancel, then do nothing
            }
#else
            if (!silent && MessageBox.Show(Lan.g(this, "Your database will now be converted") + "\r"
                                           + Lan.g(this, "from version") + " " + FromVersion.ToString() + "\r"
                                           + Lan.g(this, "to version") + " " + ToVersion.ToString() + "\r"
                                           + Lan.g(this, "The conversion works best if you are on the server.  Depending on the speed of your computer, it can be as fast as a few seconds, or it can take as long as 10 minutes.")
                                           , "", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return(false);               //If user clicks cancel, then close the program
            }
#endif
            Cursor.Current = Cursors.WaitCursor;
#if !DEBUG
            if (DataConnection.DBtype != DatabaseType.MySql &&
                !MsgBox.Show(this, true, "If you have not made a backup, please Cancel and backup before continuing.  Continue?"))
            {
                return(false);
            }
            try{
                if (DataConnection.DBtype == DatabaseType.MySql)
                {
                    MiscData.MakeABackup();                    //Does not work for Oracle, due to some MySQL specific commands inside.
                }
            }
            catch (Exception e) {
                Cursor.Current = Cursors.Default;
                if (e.Message != "")
                {
                    MessageBox.Show(e.Message);
                }
                MsgBox.Show(this, "Backup failed. Your database has not been altered.");
                return(false);
            }
            try{
#endif
            if (FromVersion < new Version("7.5.17"))
            {
                Cursor.Current = Cursors.Default;
                YN InsPlanConverstion_7_5_17_AutoMergeYN = YN.Unknown;
                if (FromVersion < new Version("7.5.1"))
                {
                    FormInsPlanConvert_7_5_17 form = new FormInsPlanConvert_7_5_17();
                    if (PrefC.GetBoolSilent(PrefName.InsurancePlansShared, true))
                    {
                        form.InsPlanConverstion_7_5_17_AutoMergeYN = YN.Yes;
                    }
                    else
                    {
                        form.InsPlanConverstion_7_5_17_AutoMergeYN = YN.No;
                    }
                    form.ShowDialog();
                    if (form.DialogResult == DialogResult.Cancel)
                    {
                        MessageBox.Show("Your database has not been altered.");
                        return(false);
                    }
                    InsPlanConverstion_7_5_17_AutoMergeYN = form.InsPlanConverstion_7_5_17_AutoMergeYN;
                }
                ConvertDatabases.Set_7_5_17_AutoMerge(InsPlanConverstion_7_5_17_AutoMergeYN);                //does nothing if this pref is already present for some reason.
                Cursor.Current = Cursors.WaitCursor;
            }
            if (FromVersion >= new Version("3.4.0"))
            {
                Prefs.UpdateBool(PrefName.CorruptedDatabase, true);
            }
            ConvertDatabases.FromVersion = FromVersion;
            ConvertDatabases.To2_8_2();            //begins going through the chain of conversion steps
            Cursor.Current = Cursors.Default;
            if (!silent)
            {
                MsgBox.Show(this, "Conversion successful");
            }
            if (FromVersion >= new Version("3.4.0"))
            {
                //CacheL.Refresh(InvalidType.Prefs);//or it won't know it has to update in the next line.
                Prefs.UpdateBool(PrefName.CorruptedDatabase, false, true);              //more forceful refresh in order to properly change flag
            }
            Cache.Refresh(InvalidType.Prefs);
            return(true);

#if !DEBUG
        }

        catch (System.IO.FileNotFoundException e) {
            MessageBox.Show(e.FileName + " " + Lan.g(this, "could not be found. Your database has not been altered and is still usable if you uninstall this version, then reinstall the previous version."));
            if (FromVersion >= new Version("3.4.0"))
            {
                Prefs.UpdateBool(PrefName.CorruptedDatabase, false);
            }
            //Prefs.Refresh();
            return(false);
        }
        catch (System.IO.DirectoryNotFoundException) {
            MessageBox.Show(Lan.g(this, "ConversionFiles folder could not be found. Your database has not been altered and is still usable if you uninstall this version, then reinstall the previous version."));
            if (FromVersion >= new Version("3.4.0"))
            {
                Prefs.UpdateBool(PrefName.CorruptedDatabase, false);
            }
            //Prefs.Refresh();
            return(false);
        }
        catch (Exception ex) {
            //	MessageBox.Show();
            MessageBox.Show(ex.Message + "\r\n\r\n"
                            + Lan.g(this, "Conversion unsuccessful. Your database is now corrupted and you cannot use it.  Please contact us."));
            //Then, application will exit, and database will remain tagged as corrupted.
            return(false);
        }
#endif
        }