Interaction logic for ProgressPage.xaml
Inheritance: System.Windows.Controls.Page
Example #1
0
 /// <summary>
 /// Handles the Click event of the btnNext control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void btnNext_Click(object sender, RoutedEventArgs e)
 {
     if (SaveChanges(true))
     {
         var nextPage = new ProgressPage();
         this.NavigationService.Navigate(nextPage);
     }
 }
 /// <summary>
 /// Handles the Click event of the btnNext control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void btnGenerateStatements_Click(object sender, RoutedEventArgs e)
 {
     if (SaveChanges(true))
     {
         var nextPage = new ProgressPage(false, null);
         this.NavigationService.Navigate(nextPage);
     }
 }
Example #3
0
        /// <summary>
        /// Handles the Click event of the btnResumeYes control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void btnResumeYes_Click(object sender, RoutedEventArgs e)
        {
            var lastRunGeneratorConfig = ContributionReport.GetSavedGeneratorConfigFromLastRun();

            var nextPage = new ProgressPage(true, lastRunGeneratorConfig.RunDate);

            ReportOptions.LoadFromConfig(lastRunGeneratorConfig);
            this.NavigationService.Navigate(nextPage);
        }
Example #4
0
        /// <summary>
        /// Handles the Click event of the btnNext control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            var selected = lstLayouts.Items.OfType <RadioButton>().First(a => a.IsChecked == true);

            if (selected != null)
            {
                string fileName = selected.Tag.ToString();
                ReportOptions.Current.LayoutFile = fileName;
                var rockConfig = RockConfig.Load();
                rockConfig.LayoutFile = fileName;
                rockConfig.Save();
                ProgressPage nextPage = new ProgressPage();
                this.NavigationService.Navigate(nextPage);
            }
        }
        /// <summary>
        /// Handles the Click event of the btnNext control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            if (txtFolderLocation.Text.Trim() == string.Empty)
            {
                MessageBoxResult result = MessageBox.Show("Please select a folder to save contribution statements to.", "Folder Location Required", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            if (!Directory.Exists(txtFolderLocation.Text))
            {
                try {
                    System.IO.Directory.CreateDirectory(txtFolderLocation.Text);
                }
                catch (Exception ex)
                {
                    MessageBoxResult result = MessageBox.Show("Could create the directory provided. Please double-check that it is a valid path.", "Path Not Valid", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }
            }

            if (txtFileName.Text == string.Empty)
            {
                MessageBoxResult result = MessageBox.Show("Please provide a base file name.", "Filename Required", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            ReportOptions.Current.BaseFileName  = txtFileName.Text;
            ReportOptions.Current.SaveDirectory = txtFolderLocation.Text;

            int chapterSize = 0;

            if (txtChapterSize.Text.Trim() != string.Empty && !int.TryParse(txtChapterSize.Text.Trim(), out chapterSize))
            {
                MessageBoxResult result = MessageBox.Show("Please provide a number for the chapter size or leave blank.", "Invalid Chapter Size", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            if (chapterSize > 0)
            {
                ReportOptions.Current.ChapterSize = chapterSize;
            }

            ProgressPage nextPage = new ProgressPage();

            this.NavigationService.Navigate(nextPage);
        }
 /// <summary>
 /// Handles the Click event of the btnRunReport control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void btnRunReport_Click( object sender, RoutedEventArgs e )
 {
     ProgressPage progressPage = new ProgressPage();
     this.NavigationService.Navigate( progressPage );
 }
Example #7
0
        /// <summary>
        /// Handles the Click event of the btnRunReport control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void btnRunReport_Click(object sender, RoutedEventArgs e)
        {
            ProgressPage progressPage = new ProgressPage();

            this.NavigationService.Navigate(progressPage);
        }
 /// <summary>
 /// Handles the Click event of the btnNext control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void btnNext_Click( object sender, RoutedEventArgs e )
 {
     var selected = lstLayouts.Items.OfType<RadioButton>().First( a => a.IsChecked == true );
     if ( selected != null )
     {
         string fileName = selected.Tag.ToString();
         ReportOptions.Current.LayoutFile = fileName;
         var rockConfig = RockConfig.Load();
         rockConfig.LayoutFile = fileName;
         rockConfig.Save();
         ProgressPage nextPage = new ProgressPage();
         this.NavigationService.Navigate( nextPage );
     }
 }