public void BackupSqlServerData() { try { var folder = new FolderBrowserDialog(); if (folder.ShowDialog() == DialogResult.OK) { FileLocation = folder.SelectedPath; if (_server != null) { var status = BackUpRestoreUtil.BackUpServerDatabase(_server, FileLocation); if (string.IsNullOrEmpty(status)) { NotifyUtility.ShowCustomBalloon("Backup Successfull", "Bakup of Database " + " successfully created", 4000); } else { MessageBox.Show("ERROR: An error ocurred while backing up DataBase" + status, "Backup Error"); } } } } catch (Exception x) { MessageBox.Show("ERROR: An error ocurred while backing up DataBase" + x.Message, "Server Error"); } }
public BackupRestoreViewModel() { if (Singleton.Edition == PinnaFaceEdition.ServerEdition) { _server = BackUpRestoreUtil.GetServer(); } ProgressBarVisibility = "Collapsed"; CommandsEnability = true; Messenger.Default.Register <object>(this, message => { MainWindow = message; }); }