public void AutoBackup(string application) { Inventori.Facade.DataMasterMgtServices DataMaster = new Inventori.Facade.DataMasterMgtServices(); Inventori.Data.MSetting set = (Inventori.Data.MSetting)DataMaster.GetObjectByProperty(typeof(Inventori.Data.MSetting), Inventori.Data.MSetting.ColumnNames.SettingId, 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(); } }
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); }