diff --git a/MainWindow.xaml b/MainWindow.xaml index c4d5062..2b4caf1 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -13,18 +13,18 @@ - + - + - + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 5f1b677..3deadc5 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -56,8 +56,12 @@ namespace formula_manage private void SQLBAK(object sender, RoutedEventArgs e) { - Windows.SQL_BAK sqlbak = new Windows.SQL_BAK(); - sqlbak.ShowDialog();//实例化并置顶打开数据库备份窗口 + MessageBoxResult sql_bak = System.Windows.MessageBox.Show("注意此功能仅作用与本地数据库(Dispensing)对于远端数据库的操作可能失败如果需要继续操作单击确定", "SQL", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); //连接失败提示 + if( sql_bak == MessageBoxResult.OK) + { + Windows.SQL_BAK sqlbak = new Windows.SQL_BAK(); + sqlbak.ShowDialog();//实例化并置顶打开数据库备份窗口 + } } private void SOFTWARE_SET(object sender, RoutedEventArgs e) { diff --git a/Windows/SQL_BAK.xaml.cs b/Windows/SQL_BAK.xaml.cs index 905f0d0..84572c5 100644 --- a/Windows/SQL_BAK.xaml.cs +++ b/Windows/SQL_BAK.xaml.cs @@ -25,7 +25,6 @@ namespace formula_manage.Windows { public SQL_BAK() { - System.Windows.MessageBox.Show("注意此功能仅作用与本地数据库(Dispensing)对于远端数据库的操作可能失败如果需要继续操作单击确定", "SQL", MessageBoxButton.OK, MessageBoxImage.Exclamation); //连接失败提示 WindowStartupLocation = WindowStartupLocation.CenterScreen; InitializeComponent(); this.Closing += Window_Closing; //添加窗口关闭事件 @@ -270,25 +269,6 @@ namespace formula_manage.Windows System.Windows.MessageBox.Show("还原失败"); } } - - - /* if ((bool)SQL_bak.IsChecked) - { - ok = Backup(SQLNAME, SQL_DISPEN_bak.Text + "\\" + SQLNAME + ".bak"); //指定地址备份 - } - else - { - ok = Backup(SQLNAME, Convert.ToString(Environment.SpecialFolder.MyDocuments) + SQLNAME + ".bak"); //默认备份到文档文件夹 - } - - if (ok) - { - System.Windows.MessageBox.Show("还原成功"); - } - else - { - System.Windows.MessageBox.Show("还原失败"); - } */ } }