コード例 #1
0
        private void btnExportDb_Click(object sender, RoutedEventArgs e)
        {
            if (service.User == null)
            {
                MessageBox.Show(@"You must be logged in to do that.", "Login required", MessageBoxButton.OK,
                                MessageBoxImage.Exclamation);
                return;
            }
            var result =
                MessageBox.Show(
                    "All results data from your project will be copied to DMS\nTo see what will be transferred, click \"Open Results\" to view your project folder.\n\nAre you sure you want to continue?",
                    "Are you sure?", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                try
                {
                    DMSValidation dms = new DMSValidation();
                    dms.Show();
                    testApp.ToDms();
                }
                catch (DirectoryNotFoundException ex)
                {
                    MessageBox.Show(
                        "Project folder: \"" + ex.Message +
                        "\" was not found! Make sure that you have transferred results to this project.",
                        "Directory Not Found", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
コード例 #2
0
ファイル: CustomRun.xaml.cs プロジェクト: cobelab/LabRun
 private void btnTransferToDMS_Click(object sender, RoutedEventArgs e)
 {
     if (service.User == null)
     {
         MessageBox.Show(@"You must be logged in to do that.", "Login required", MessageBoxButton.OK,
             MessageBoxImage.Exclamation);
         return;
     }
     var result =
         MessageBox.Show(
             "All results data from your project will be copied to DMS\nTo see what will be transferred, click \"Open Results\" to view your project folder.\n\nAre you sure you want to continue?",
             "Are you sure?", MessageBoxButton.YesNo, MessageBoxImage.Question);
     if (result == MessageBoxResult.Yes)
     {
         try
         {
             if (crTestApp == null)
             {
                 crTestApp = new CustomRunTestApp(extensions);
                 SetProject(parent.getProject());
                 crTestApp.testFolder = service.Config.Computerinstallpath;
             }
             DMSValidation dms = new DMSValidation();
             dms.Show();
             crTestApp.ToDms();
         }
         catch (DirectoryNotFoundException ex)
         {
             MessageBox.Show(
                 "Project folder: \"" + ex.Message +
                 "\" was not found! Make sure that you have transferred results to this project.",
                 "Directory Not Found", MessageBoxButton.OK, MessageBoxImage.Error);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
 }