private void OnSelectedAccountChanged()
 {
     _accountDetailsViewModel.Account = SelectedAccount;
     CurrentViewModel = _accountDetailsViewModel;
     EditCommand.RaiseCanExecuteChanged();
     RemoveCommand.RaiseCanExecuteChanged();
 }
Beispiel #2
0
 protected override void OnPropertyChanged(string propertyName)
 {
     base.OnPropertyChanged(propertyName);
     EditCommand.RaiseCanExecuteChanged();
     EditPricesCommand.RaiseCanExecuteChanged();
     DeleteUserCommand.RaiseCanExecuteChanged();
 }
 private void NotifyCommands()
 {
     EditCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
     PrintCommand.RaiseCanExecuteChanged();
     PreviewCommand.RaiseCanExecuteChanged();
     PaymentsCommand.RaiseCanExecuteChanged();
 }
Beispiel #4
0
        private async void Init(string ip)
        {
            await Load(null);

            QueryCommand.RaiseCanExecuteChanged();
            AddCommand.RaiseCanExecuteChanged();
            EditCommand.RaiseCanExecuteChanged();
            DeleteCommand.RaiseCanExecuteChanged();
        }
 public override void RaiseCanExecuteChanges()
 {
     base.RaiseCanExecuteChanges();
     EditCommand.RaiseCanExecuteChanged();
     CopyCommand.RaiseCanExecuteChanged();
     MoveCommand.RaiseCanExecuteChanged();
     NewFolderCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
 }
 private void RemoveAccount()
 {
     if (SelectedAccount != null)
     {
         _allAccounts.Remove(SelectedAccount);
         EditCommand.RaiseCanExecuteChanged();
         RemoveCommand.RaiseCanExecuteChanged();
     }
 }
 private void raise()
 {
     OnPropertyChanged(() => Message);
     OnPropertyChanged(() => ReportTypesMessage);
     OnPropertyChanged(() => PossibleDesigners);
     OnPropertyChanged(() => ActiveDesigner);
     OnPropertyChanged(() => ScreenState);
     EditCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
 }
 private void TestListViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "CurrentTest")
     {
         BeginCommand.RaiseCanExecuteChanged();
         AddCommand.RaiseCanExecuteChanged();
         EditCommand.RaiseCanExecuteChanged();
         ShowResultsCommand.RaiseCanExecuteChanged();
     }
 }
        private void RaiseCanExecuteChanged()
        {
            RaisePropertyChanged();

            AddCommand.RaiseCanExecuteChanged();
            EditCommand.RaiseCanExecuteChanged();
            SaveCommand.RaiseCanExecuteChanged();
            DelCommand.RaiseCanExecuteChanged();
            TranslateSelectedCommand.RaiseCanExecuteChanged();
        }
Beispiel #10
0
 protected void UpdateCrudCommands()
 {
     ExecuteUIThread(() =>
     {
         EditCommand.RaiseCanExecuteChanged();
         SaveCommand.RaiseCanExecuteChanged();
         CancelCommand.RaiseCanExecuteChanged();
         AddCommand.RaiseCanExecuteChanged();
         DeleteCommand.RaiseCanExecuteChanged();
     });
 }
Beispiel #11
0
 public override void AfterItemPermissionsCompleted()
 {
     base.AfterItemPermissionsCompleted();
     NewCommand.RaiseCanExecuteChanged();
     EditCommand.RaiseCanExecuteChanged();
     SaveCommand.RaiseCanExecuteChanged();
     SearchCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
     PrintCommand.RaiseCanExecuteChanged();
     CancelCommand.RaiseCanExecuteChanged();
     ExportCommand.RaiseCanExecuteChanged();
 }
 private void NavigateAddAccount()
 {
     try
     {
         _addEditAccountViewModel.EditMode = false;
         _addEditAccountViewModel.Account  = new EditableAccount();
         CurrentViewModel = _addEditAccountViewModel;
         EditCommand.RaiseCanExecuteChanged();
         RemoveCommand.RaiseCanExecuteChanged();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
 private void NavigateEditAccount()
 {
     try
     {
         _addEditAccountViewModel.EditMode = true;
         _addEditAccountViewModel.Account  = ConvertToEditableACcount(SelectedAccount);
         CurrentViewModel = _addEditAccountViewModel;
         EditCommand.RaiseCanExecuteChanged();
         RemoveCommand.RaiseCanExecuteChanged();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
 private void OnReturnedTo(object sender, AccountsChangedEventArgs e)
 {
     try
     {
         if (!e.ChangeCanceled)
         {
             Account account = ConvertToACcount(e.Account);
             if (e.EditMode)
             {
                 Account listAccount = _allAccounts.FirstOrDefault(a => a.Id == account.Id);
                 if (listAccount != null)
                 {
                     _allAccounts[_allAccounts.IndexOf(listAccount)] = account;
                     SelectedAccount = account;
                 }
             }
             else
             {
                 if (_allAccounts.Any())
                 {
                     account.Id = _allAccounts.Select(a => a.Id).Max() + 1;
                     _allAccounts.Add(account);
                     SelectedAccount = account;
                 }
                 else
                 {
                     account.Id = 0;
                     _allAccounts.Add(account);
                     SelectedAccount = account;
                 }
             }
         }
         CurrentViewModel = _accountDetailsViewModel;
         EditCommand.RaiseCanExecuteChanged();
         RemoveCommand.RaiseCanExecuteChanged();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
 void cv_CurrentChanged(object sender, EventArgs e)
 {
     EditCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
 }
Beispiel #16
0
 private void RequeryCommandEnabled()
 {
     EditCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
 }
 private void CanEditExecuteChanged(object obj)
 {
     EditCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
 }
        protected TechnicalRequrementsTasksBaseViewModel(IUnityContainer container) : base(container)
        {
            //костыль - удаление пустых задач
            RemoveFailTasks();

            Load();

            this.SelectedLookupChanged += lookup =>
            {
                EditCommand.RaiseCanExecuteChanged();
                RemoveCommand.RaiseCanExecuteChanged();
            };

            #region Commands

            NewCommand = new DelegateLogCommand(
                () =>
            {
                //RegionManager.RequestNavigateContentRegion<PriceCalculations.View.PriceCalculationView>(new NavigationParameters { { nameof(PriceCalculation), new PriceCalculation() } });
            });


            EditCommand = new DelegateLogCommand(
                () =>
            {
                RegionManager.RequestNavigateContentRegion <TechnicalRequrementsTaskView>(new NavigationParameters {
                    { nameof(TechnicalRequrementsTask), SelectedItem }
                });
            },
                () => SelectedItem != null);

            RemoveCommand = new DelegateLogCommand(
                () =>
            {
                //var messageService = Container.Resolve<IMessageService>();
                //var result = messageService.ShowYesNoMessageDialog("Удаление", "Действительно хотите удалить из расчет ПЗ?", defaultNo:true);
                //if (result != MessageDialogResult.Yes) return;

                //var unitOfWork = Container.Resolve<IUnitOfWork>();

                //var calculation = unitOfWork.Repository<PriceCalculation>().GetById(SelectedItem.Id);
                //foreach (var item in calculation.PriceCalculationItems.ToList())
                //{
                //    var salesUnits = item.SalesUnits.ToList();

                //    //единицы, которы нельзя удалить из расчета, т.к. они размещены в производстве
                //    var salesUnitsNotForRemove = salesUnits
                //        .Where(x => x.SignalToStartProduction.HasValue)
                //        .Where(x => x.ActualPriceCalculationItem(unitOfWork).Id == item.Id)
                //        .ToList();

                //    if (salesUnitsNotForRemove.Any())
                //    {
                //        var salesUnitsToRemove = salesUnits.Except(salesUnitsNotForRemove).ToList();
                //        salesUnitsToRemove.ForEach(x => item.SalesUnits.Remove(x));
                //        if (!item.SalesUnits.Any())
                //        {
                //            calculation.PriceCalculationItems.Remove(item);
                //            unitOfWork.Repository<PriceCalculationItem>().Delete(item);
                //        }
                //    }
                //    else
                //    {
                //        calculation.PriceCalculationItems.Remove(item);
                //        unitOfWork.Repository<PriceCalculationItem>().Delete(item);
                //    }
                //}

                //if (calculation.PriceCalculationItems.Any())
                //{
                //    messageService.ShowOkMessageDialog("Удаление", "Вы не можете удалить некоторые строки в расчете, т.к. они размещены в производстве.");
                //}
                //else
                //{
                //    unitOfWork.Repository<PriceCalculation>().Delete(calculation);
                //    ((ICollection<PriceCalculationLookup>)Lookups).Remove(SelectedLookup);
                //}

                //unitOfWork.SaveChanges();
            },
                () => SelectedItem != null);

            ReloadCommand = new DelegateLogCommand(Load);

            #endregion
        }
Beispiel #19
0
 private void ReversalListViewmodel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     AddCommand.RaiseCanExecuteChanged();
     EditCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
 }