void timer_Elapsed(object sender, ElapsedEventArgs e) { try { timer.Interval = Helper.Add24HrsInterval; log.Info("Next backup will be taken on : " + DateTime.Now.AddMilliseconds(Helper.Add24HrsInterval).ToString(Helper.AppConstants.DateTimeFormat)); var ObjBackupConfig = ProcessHandler.GetBackConfig(); BackupHandler.BackupDatabase(ObjBackupConfig); } catch (Exception ex) { log.Error(ex); } }
void TestBackupWorker_DoWork(object sender, DoWorkEventArgs e) { try { ImageVisibility(true); var ObjBackupConfig = GetBackupConfig(); ProcessingStatus("Taking Backup @ " + ObjBackupConfig.BackupLocation); BackupHandler.BackupDatabase(ObjBackupConfig); ImageVisibility(false); MessageBox.Show("Test Backup successfull.", "Success"); } catch (Exception) { ImageVisibility(false); // } }