protected override void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            base.UserControl_Loaded(sender, e);

            //nugget: see here: http://social.msdn.microsoft.com/forums/en-US/wpf/thread/63974f4f-d9ee-45af-8499-42f29cbc22ae?prof=required
            //nugget: unfortunately any kind of code driven or user driven sorting blows away custom DataGridColumn.GetCellContent() modifications like my initial hyperlinking approach... i'll have to come back to this
            //gridRemarks_HyperLinkOrderNumbers();

            WPFHelpers.GridSort(gridForms, "Purchased", System.ComponentModel.ListSortDirection.Descending);
            WPFHelpers.GridSort(gridRemarks, new string[] { "Alert", "LastUpdate" }, new ListSortDirection[] { ListSortDirection.Descending, ListSortDirection.Descending });

            SponsorBO.Transactions.CollectionChanged += (s, a) => { if (a.NewItems != null)
                                                                    {
                                                                        TransactionsDataGrid.ScrollIntoView(a.NewItems[0]);
                                                                    }
            };                                                                                                                               //nugget: AutoScroll DataGrid
            rdoHideReturnedTaxForms.IsChecked = true;

            if (SponsorBO.TaxForms_CountReturnedNotFiled > 0)
            {
                ReturnedNotFiledLabel.Background = ReturnedNotFiledLabel.Background.BeginBrushColorAnimation(Colors.Red);
            }

            //btnSuspend_Checked(null, null); //just to jiggle the
        }
Ejemplo n.º 2
0
        protected override void UserControlLoaded(object sender, RoutedEventArgs e)
        {
            Sponsor.ReasonConfirmation += SponsorReasonConfirmation;

            InitializePotentialMatchesGridGrouping();

            WPFHelpers.GridSort(gridForms, "Purchased", ListSortDirection.Descending);
            WPFHelpers.GridSort(gridRemarks, new[] { "Alert", "LastUpdate" }, new[] { ListSortDirection.Descending, ListSortDirection.Descending });

            Sponsor.Transactions.CollectionChanged += (s, a) => { if (a.NewItems != null)
                                                                  {
                                                                      TransactionsDataGrid.ScrollIntoView(a.NewItems[0]);
                                                                  }
            };                                                                                                                             //nugget: AutoScroll DataGrid
            rdoHideReturnedTaxForms.IsChecked = true;

            if (Sponsor.TaxFormsCountReturnedNotFiled > 0)
            {
                ReturnedNotFiledLabel.Background = ReturnedNotFiledLabel.Background.BeginBrushColorAnimation(Colors.Red);
            }

            if (Sponsor.Class1TaxFormsCountUnreturned > SettingsModel.MaxClass1FormsCount)
            {
                UnreturnedLabel.Background = UnreturnedLabel.Background.BeginBrushColorAnimation(Colors.Red);
            }

            Sponsor.PropertyChanged += SponsorPropertyChanged;

            gridMembers.ItemContainerGenerator.ContainerFromIndex(0).FindChild <TextBox>(c => c.Name == "txtSSN1").Focus();
        }
Ejemplo n.º 3
0
 protected override void UserControlLoaded(object sender, RoutedEventArgs e)
 {
     WPFHelpers.GridSort(gridRemarks, new[] { "Alert", "LastUpdate" }, new[] { ListSortDirection.Descending, ListSortDirection.Descending });
     UsedDate.Focus();
 }
Ejemplo n.º 4
0
        private void ActivityStartEndDateChanged(object sender, SelectionChangedEventArgs e)
        {
            if (WPFHelpers.DesignMode)
            {
                return;                  //there was an annoying exception that would close down all of VS2010
            }
            if (dateActivityStart == null || dateActivityStart.SelectedDate == null || dateActivityEnd == null || dateActivityEnd.SelectedDate == null)
            {
                return;
            }

            long minticks = Math.Min(dateActivityStart.SelectedDate.Value.Ticks, dateActivityEnd.SelectedDate.Value.Ticks);

            if (minticks < dateRangeActivity.Minimum.Ticks)
            {
                dateRangeActivity.Minimum = new DateTime(minticks);                                       //expand the slider's minimum allowed if we're trying to go further back in time with the date boxes
            }
            if (_queryThread != null)
            {
                _queryThread.Abort();
            }
            _queryThread = new Thread(delegate(object state)
            {
                Thread.Sleep(1500); //slight delay to smooth out reacting to the slider while it's still being drug around

                var parms = state as DateRange;
                Debug.Assert(parms != null, "parms != null");
                var daysspanned = (parms.End - parms.Start).Days;
                if (daysspanned > 30)
                {
                    if (MessageBoxResult.Cancel == MessageBox.Show(
                            String.Format("That's a {0} day span.\rIt will make the database really smoke, are you sure?", daysspanned),
                            "Warning", MessageBoxButton.OKCancel, MessageBoxImage.Warning))
                    {
                        return;                                                     //nugget: aint that nice that MessageBox goes switches to the UI thread for us
                    }
                }
// ReSharper disable InconsistentNaming
                using (Proc DailyActivity_s = new iTRAACProc("DailyActivity_s"))
// ReSharper restore InconsistentNaming
                {
                    DailyActivity_s["@ActivityType"] = parms.ActivityType;
                    DailyActivity_s["@StartDate"]    = parms.Start;
                    DailyActivity_s["@EndDate"]      = parms.End;
                    var t = DailyActivity_s.ExecuteDataSet().Table0;
                    parms.Me.Dispatcher.Invoke((Action) delegate
                    {
                        var dv = (parms.Me.gridDailyActivity.ItemsSource as DataView);
                        if (dv != null)
                        {
                            dv.Table.Dispose();
                        }
                        parms.Me.gridDailyActivity.ItemsSource = t.DefaultView;
                        WPFHelpers.GridSort(parms.Me.gridDailyActivity, "Purchased", System.ComponentModel.ListSortDirection.Descending);
                    });
                }
            });
            _queryThread.Start(new DateRange(this, (string)cbxActivityType.SelectedValue, dateActivityStart.SelectedDate.Value, dateActivityEnd.SelectedDate.Value));

            if (_skipCbxActivityDateSelectionChanged)
            {
                return;
            }
            cbxActivityDate.SelectedValue = "CUSTOM";
        }
Ejemplo n.º 5
0
 void gridForms_Loaded(object sender, RoutedEventArgs e)
 {
     WPFHelpers.GridSort(gridForms, "Purchased", System.ComponentModel.ListSortDirection.Descending);
 }