Exemple #1
0
 private void RaiseCanExecuteCommands()
 {
     NextMonthCommand.RaiseCanExecuteChanged();
     PreviousMonthCommand.RaiseCanExecuteChanged();
     RemoveUserCommand.RaiseCanExecuteChanged();
     CurrentMonthCommand.RaiseCanExecuteChanged();
     SearchCommand.RaiseCanExecuteChanged();
     ClearAllCommand.RaiseCanExecuteChanged();
     PrintCommand.RaiseCanExecuteChanged();
 }
Exemple #2
0
        private void GetValue()
        {
            var totalMiles    = new List <MilesChartData>();
            var invoicedMiles = new List <MilesChartData>();

            for (var i = startDay; i < startDay + 10; i++)
            {
                var dataMiles = dataCache.FirstOrDefault(x => x.Day == i + 1);
                var dt        = new DateTime(SelectedYear, SelectedMonth, i + 1);

                totalMiles.Add(new MilesChartData {
                    Month = dt.ToString("dd ddd"), Quantity = dataMiles?.TotalMiles ?? 0
                });
                invoicedMiles.Add(new MilesChartData {
                    Month = dt.ToString("dd ddd"), Quantity = dataMiles?.InvoicedMiles ?? 0
                });
            }

            TraveledMiles = new ObservableCollection <MilesChartData>(totalMiles);
            InvoicedMiles = new ObservableCollection <MilesChartData>(invoicedMiles);

            NextMonthCommand.RaiseCanExecuteChanged();
            PreviousMonthCommand.RaiseCanExecuteChanged();
        }