Exemplo n.º 1
0
        void BackupDatabaseStart(bool isEnd)
        {
            DateTime startTime = DateTime.Now;

            bool isNorthWind = SourceDatabase.ToLower().IndexOf("northwind") >= 0;

            textBackupDatabase = "BackupDatabase 1";

            try
            {
                if (!isNorthWind)                                               //	Can't handle Northwind images
                {
                    ZipFile.InitializeDatabase(SourceDatabase);
                    errors.Clear();
                    BackupDatabase(SourceDatabase);
                }
            }
            catch (Exception e)
            {
                Error("VEAdmin.BackupDatabase Error: " + textBackupDatabase + "\r\n" + e.Message);
            }
            finally
            {
                if (!isNorthWind)
                {
                    zipFile.Close();
                }

                Memo("Totals", string.Format("/***\r\n****\t{0}\r\n****\tBackup Database {1}\r\n****\t{2}\r\n***/\r\n",
                                             BackupTimeStamp, backupServerDatabase,
                                             abort ? "*** ABORTED ***" : isNorthWind ? "*** NorthWind Exclusion ***" : "Completed: " + VETimeStamp.ElapsedTime(startTime)));

                ListErrors();

                if (isEnd)
                {
                    Memo("End", "");
                }
            }
        }