Ejemplo n.º 1
0
        public void AutoBackup(string application)
        {
            if (set == null)
            {
                return;
            }

            if (set.AutoBackup)
            {
                if (f_BackupDB != null)
                {
                    if (!f_BackupDB.IsDisposed)
                    {
                        f_BackupDB.Close();
                    }
                }
                f_BackupDB = new FormBackupDatabase();
                f_BackupDB.lbl_UserName.Text = toolStripStatusLabelLoginName.Text;
                string BackupFileExtention = "backup";

                f_BackupDB.txt_BackupFile.Text = set.BackupDir + "\\" + DateTime.Now.ToString("yyyyMMddHHmmss.") + BackupFileExtention;
                f_BackupDB.lbl_Auto.Text       = set.AutoBackup.ToString();
                f_BackupDB.ShowDialog();
            }
        }
Ejemplo n.º 2
0
 private void backupDatabaseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (f_BackupDB != null)
     {
         if (!f_BackupDB.IsDisposed)
         {
             f_BackupDB.Close();
         }
     }
     f_BackupDB = new FormBackupDatabase();
     f_BackupDB.lbl_UserName.Text = toolStripStatusLabelLoginName.Text;
     f_BackupDB.Show(dockPanel1);
 }
Ejemplo n.º 3
0
        private void AutoBackup()
        {
            MSetting set = (MSetting)DataMaster.GetObjectById(typeof(MSetting), AppCode.AssemblyProduct);

            if (set.AutoBackup)
            {
                if (f_BackupDB != null)
                {
                    if (!f_BackupDB.IsDisposed)
                    {
                        //f_BackupDB.WindowState = FormWindowState.Normal;
                        //f_BackupDB.BringToFront();
                        f_BackupDB.Close();
                        f_BackupDB = new FormBackupDatabase();
                    }
                    else
                    {
                        f_BackupDB = new FormBackupDatabase();
                    }
                }
                else
                {
                    f_BackupDB = new FormBackupDatabase();
                }

                string BackupFileExtention = "backup";

                f_BackupDB.txt_BackupFile.Text = set.BackupDir + "\\" + DateTime.Now.ToString("yyyyMMddHHmmss.") + BackupFileExtention;
                f_BackupDB.lbl_Auto.Text       = set.AutoBackup.ToString();
                f_BackupDB.ShowDialog();
            }
            //e.Cancel = false;

            //Application.Exit();
            //try
            //{
            //    System.Environment.Exit(1);
            //}
            //catch (Exception)
            //{
            //}
        }