Interaction logic for SelectAccountsPage.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 (radAllPersons.IsChecked ?? false)
            {
                ReportOptions.Current.PersonId = null;
            }
            else
            {
                if (grdPersons.SelectedValue != null)
                {
                    // they selected a person in the grid
                    ReportOptions.Current.PersonId = (int)grdPersons.SelectedValue.GetPropertyValue("Id");
                }
                else if (grdPersons.Items.Count == 1)
                {
                    // they didn't select a person in the grid, but there is only one listed. So, that is who they want to run the report for
                    ReportOptions.Current.PersonId = (int)grdPersons.Items[0].GetPropertyValue("Id");
                }
                else
                {
                    // no person is selected, show a warning message
                    lblWarning.Visibility = Visibility.Visible;
                    return;
                }
            }

            SelectAccountsPage nextPage = new SelectAccountsPage();

            this.NavigationService.Navigate(nextPage);
        }
Example #2
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 SelectAccountsPage();
         this.NavigationService.Navigate(nextPage);
     }
 }
Example #3
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 (radAllPersons.IsChecked ?? false)
            {
                ReportOptions.Current.DataViewId = null;
                ReportOptions.Current.PersonId   = null;
            }
            else if (radDataView.IsChecked ?? false)
            {
                if (ddlDataView.SelectedValue != null)
                {
                    ReportOptions.Current.DataViewId = (int)ddlDataView.SelectedValue.GetPropertyValue("Id");
                    ReportOptions.Current.PersonId   = null;
                }
                else
                {
                    // no dataview is selected, show a warning message
                    lblWarning.Content    = "Please select a Dataview when 'Dataview' is checked.";
                    lblWarning.Visibility = Visibility.Visible;
                    return;
                }
            }
            else
            {
                if (grdPersons.SelectedValue != null)
                {
                    // they selected a person in the grid
                    ReportOptions.Current.PersonId = (int)grdPersons.SelectedValue.GetPropertyValue("Id");
                }
                else if (grdPersons.Items.Count == 1)
                {
                    // they didn't select a person in the grid, but there is only one listed. So, that is who they want to run the report for
                    ReportOptions.Current.PersonId = (int)grdPersons.Items[0].GetPropertyValue("Id");
                }
                else
                {
                    // no person is selected, show a warning message
                    lblWarning.Content    = "Please select a person when 'Single individual' is checked.";
                    lblWarning.Visibility = Visibility.Visible;
                    return;
                }
            }

            ReportOptions.Current.IncludeIndividualsWithNoAddress = ckIncludeIndividualsWithNoAddress.IsChecked ?? false;

            SelectAccountsPage nextPage = new SelectAccountsPage();

            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 ( radAllPersons.IsChecked ?? false )
            {
                ReportOptions.Current.DataViewId = null;
                ReportOptions.Current.PersonId = null;
            }
            else if ( radDataView.IsChecked ?? false )
            {
                if ( ddlDataView.SelectedValue != null )
                {
                    ReportOptions.Current.DataViewId = (int)ddlDataView.SelectedValue.GetPropertyValue( "Id" );
                    ReportOptions.Current.PersonId = null;
                }
                else
                {
                    // no dataview is selected, show a warning message
                    lblWarning.Content = "Please select a Dataview when 'Dataview' is checked.";
                    lblWarning.Visibility = Visibility.Visible;
                    return;
                }
            }
            else
            {
                if ( grdPersons.SelectedValue != null )
                {
                    // they selected a person in the grid
                    ReportOptions.Current.PersonId = (int)grdPersons.SelectedValue.GetPropertyValue( "Id" );
                }
                else if ( grdPersons.Items.Count == 1 )
                {
                    // they didn't select a person in the grid, but there is only one listed. So, that is who they want to run the report for
                    ReportOptions.Current.PersonId = (int)grdPersons.Items[0].GetPropertyValue( "Id" );
                }
                else
                {
                    // no person is selected, show a warning message
                    lblWarning.Content = "Please select a person when 'Single individual' is checked.";
                    lblWarning.Visibility = Visibility.Visible;
                    return;
                }
            }

            ReportOptions.Current.IncludeIndividualsWithNoAddress = ckIncludeIndividualsWithNoAddress.IsChecked ?? false;

            SelectAccountsPage nextPage = new SelectAccountsPage();
            this.NavigationService.Navigate( nextPage );
        }
Example #5
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 ( radAllPersons.IsChecked ?? false )
            {
                ReportOptions.Current.PersonId = null;
            }
            else
            {
                if ( grdPersons.SelectedValue != null )
                {
                    // they selected a person in the grid
                    ReportOptions.Current.PersonId = (int)grdPersons.SelectedValue.GetPropertyValue( "Id" );
                }
                else if ( grdPersons.Items.Count == 1 )
                {
                    // they didn't select a person in the grid, but there is only one listed. So, that is who they want to run the report for
                    ReportOptions.Current.PersonId = (int)grdPersons.Items[0].GetPropertyValue( "Id" );
                }
                else
                {
                    // no person is selected, show a warning message 
                    lblWarning.Visibility = Visibility.Visible;
                    return;
                }
            }

            SelectAccountsPage nextPage = new SelectAccountsPage();
            this.NavigationService.Navigate( nextPage );
        }