Esempio n. 1
0
        private void btnOkNew_Click(object sender, RoutedEventArgs e)
        {
            string BackUpLocation = txtPath.Text.Trim();
            string DatabaseName   = CboDb.SelectedValue.ToString().Trim();

            try
            {
                if (Option1.IsChecked == true)
                {
                    bll.RestoreDb(DatabaseName, BackUpLocation);
                    MessageBox.Show("Successfully Restore", "Mess", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    string BackUpFileName = CboDb.SelectedValue.ToString().Trim() + dtpNgay.SelectedDate.Value.ToString("yyyyMMdd") + ".bak";
                    string tuPath         = BackUpLocation + BackUpFileName;
                    MessageBox.Show(DatabaseName + "      " + tuPath);
                    bll.BackUpDb(DatabaseName, tuPath);
                    MessageBox.Show("Successfully Backup", "Mess", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }