Beispiel #1
0
 public PlanCertificateViewModelInterceptor(
     IMessageBus messageBus,
     IFilterViewModelFactory filterViewModelFactory)
 {
     _messageBus  = messageBus;
     _filerObject =
         filterViewModelFactory
         .Create <PlanReceiptOrderPersonalAccountFilter, PersonalAccountOfPlanReceiptOrderLiteDto>();
     _filterCertificate = filterViewModelFactory.Create <PlanCertificateFilter, PlanCertificateLiteDto>();
 }
Beispiel #2
0
 public ActSelectionOfProbeViewModelInterceptor(
     IMessageBus messageBus,
     IFilterViewModelFactory filterViewModelFactory)
 {
     _messageBus  = messageBus;
     _filerObject =
         filterViewModelFactory
         .Create <ActSelectionOfProbeFilter, ActSelectionOfProbeLiteDto>();
     _filterActSelectionOfProbeDepartment            = filterViewModelFactory.Create <ActSelectionOfProbeDepartmentFilter, ActSelectionOfProbeDepartmentLiteDto>();
     _filterActSelectionOfProbeDepartmentRequirement = filterViewModelFactory.Create <ActSelectionOfProbeDepartmentRequirementFilter, ActSelectionOfProbeDepartmentRequirementLiteDto>();
 }
 public CertificateQualityRestFilterViewModel(
     IScreen screen,
     IUnitOfWorkFactory unitOfWorkFactory,
     IFilterViewModelFactory filterViewModelFactory)
     : base(unitOfWorkFactory)
 {
     GostCast = filterViewModelFactory.Create <CertificateQualityFilter, CertificateQualityDto>();
     GostMix  = filterViewModelFactory.Create <CertificateQualityFilter, CertificateQualityDto>();
     Marka    = filterViewModelFactory.Create <CertificateQualityFilter, CertificateQualityDto>();
     Mix      = filterViewModelFactory.Create <CertificateQualityFilter, CertificateQualityDto>();
     NomenclatureNumberFilterViewModel =
         filterViewModelFactory.Create <NomenclatureNumberFilter, NomenclatureNumberDto>();
     HostScreen = screen;
     Filter     = CertificateQualityFilter.Default;
 }
Beispiel #4
0
        private ReactiveCommand CreateShowScanCertificateCommand(IObservable <bool> canExecuteObservable = null)
        {
            var command = new ReactiveCommand(canExecuteObservable);

            command.IsExecuting.Subscribe(isBusy => IsBusy = isBusy);
            command.RegisterAsyncFunction(_ =>
            {
                var filtering =
                    _filterViewModelFactory.Create <AttachedDocumentFilter, AttachedDocumentDto>();

                filtering.Filter.Document = SelectedCertificateQuality.Rn;

                filtering.Wait();

                var certificateQuality = new CertificateQuality(SelectedCertificateQuality.Rn);
                if (filtering.Result.Any())
                {
                    filtering.Result.MapTo <CertificateQualityAttachedDocument>()
                    .DoForEach(doc => certificateQuality.Documents.Add(doc));
                }

                var viewModel = _routableViewModelManager.Get <IAttachedDocumentViewModel>();
                viewModel.SetHasDocument(certificateQuality);

                return(viewModel);
            }).Subscribe(viewModel => HostScreen.Router.Navigate.Execute(viewModel));

            return(command);
        }
Beispiel #5
0
        public EditablePersonalAccountViewModel(
            IScreen screen,
            IMessageBus messageBus,
            IUnitOfWorkFactory unitOfWork,
            IFilterViewModelFactory filterViewModelFactory,
            IRoutableViewModelManager routableViewModelManager,
            IValidatorFactory validatorFactory)
            : base(screen, messageBus, validatorFactory)
        {
            _filterViewModelFactory        = filterViewModelFactory;
            _unitOfWorkFactory             = unitOfWork;
            PersonalAccountFilterViewModel = _filterViewModelFactory.Create <PersonalAccountFilter, PersonalAccountDto>();
            ContractViewModel = routableViewModelManager.Get <IContractViewModel>();

            this.WhenAny(x => x.UserContractor, x => x.Value)
            .Where(x => x != null)
            .Subscribe(x =>
            {
                ContractViewModel.ContractFilterViewModel.SetFilter(new ContractFilter {
                    Contaractor = x, State = ContractStatusState.Approved
                });
                ContractViewModel.StagesOfTheContractFilterViewModel.SetFilter(new StagesOfTheContractFilter {
                    State = StageStatusState.Open
                });
                ContractViewModel.ContractFilterViewModel.InvokeCommand.Execute(null);
            });
        }
 public PlanReceiptOrderViewModelInterceptor(
     IMessageBus messageBus,
     IFilterViewModelFactory filterViewModelFactory)
 {
     _messageBus  = messageBus;
     _filerObject = filterViewModelFactory.Create <PlanReceiptOrderFilter, PlanReceiptOrderLiteDto>();
 }
        private User GetUser(IFilterViewModelFactory filterFactory)
        {
            var filterPC = filterFactory.Create <UserFilter, UserDto>();

            filterPC.Wait();

            return(filterPC.Result.First().MapTo <User>());
        }
        private CertificateQuality GetCertificateQuality(IFilterViewModelFactory filterFactory)
        {
            var filterPC = filterFactory.Create <CertificateQualityFilter, CertificateQualityDto>();

            filterPC.Wait();

            return(filterPC.Result.First().MapTo <CertificateQuality>());
        }
        public void ДопустимИзменяюПоставщика(string p0)
        {
            var filterViewModel = _filterViewModelFactory.Create <UserFilter, UserDto>();

            filterViewModel.Wait();

            this._viewModel.EditableObject.UserContractor = filterViewModel.Result.First().MapTo <User>();
        }
        private PlanReceiptOrder GetPlanReceiptOrder(IFilterViewModelFactory filterFactory)
        {
            var filterPC = filterFactory.Create <PlanReceiptOrderFilter, PlanReceiptOrderDto>();

            filterPC.Wait();

            return(filterPC.Result.First().MapTo <PlanReceiptOrder>());
        }
 public EditablePassViewModel(
     IScreen screen,
     IFilterViewModelFactory filterViewModelFactory,
     IMessageBus messageBus,
     IValidatorFactory validatorFactory)
     : base(screen, messageBus, validatorFactory)
 {
     DictionaryPassFilterViewModel = filterViewModelFactory.Create <DictionaryPassFilter, DictionaryPassLiteDto>();
     DictionaryPassFilterViewModel.InvokeCommand.Execute(null);
 }
Beispiel #12
0
        private List <FilterViewModel> GetFilterViewModels()
        {
            var filters = _queryBus.Execute(new GetFiltersQuery());

            var viewModels = filters
                             .Select(p => _factory.Create(p))
                             .ToList();

            return(viewModels);
        }
        public EditableChemicalViewModel(IScreen screen, IFilterViewModelFactory filterViewModelFactory)
            : base(screen)
        {
            var loader = filterViewModelFactory.Create <ChemicalIndicatorValueFilter, ChemicalIndicatorValueDto>();

            loader.WhenAny(x => x.IsBusy, x => x.Value).Subscribe(isBusy => IsLoad = isBusy);
            loader.WhenAny(x => x.Result, x => x.Value)
            .Subscribe(res => ChemicalIndicatorValues = res);

            loader.InvokeCommand.Execute(null);
        }
 public ChangeGroupStateViewModel(
     IScreen screen,
     IUnitOfWorkFactory unitOfWorkFactory,
     IFilterViewModelFactory filterViewModelFactory,
     IMessenger messenger)
 {
     this.HostScreen         = screen;
     this._unitOfWorkFactory = unitOfWorkFactory;
     this.messenger          = messenger;
     this.FilteringObject    = filterViewModelFactory.Create <PersonalAccountFilter, PersonalAccountDto>();
 }
        public Task InitViewModel(AttachedDocumentViewModel viewModel)
        {
            var taskDocType =
                _filterViewModelFactory.Create <AttachedDocumentTypeFilter, AttachedDocumentTypeDto>().GetInvokedTask();

            return(Task.Factory.ContinueWhenAll(
                       new Task[] { taskDocType },
                       tasks =>
            {
                viewModel.AttachedDocumentTypes = taskDocType.Result.MapTo <AttachedDocumentType>();
            }));
        }
Beispiel #16
0
        public Task InitViewModel(EditablePlanCertificateViewModel viewModel)
        {
            Contract.Requires(viewModel != null, "The view model must be not null");
            Contract.Requires(viewModel.EditableObject != null, "The editable object must be not null");
            Contract.Ensures(Contract.Result <Task>() != null);

            var taskUnitOfMeasure  = _filterViewModelFactory.Create <UnitOfMeasureFilter, UnitOfMeasureDto>().GetInvokedTask();
            var taskNameOfCurrency = _filterViewModelFactory.Create <EmptyFilter, NameOfCurrencyDto>().GetInvokedTask();
            var taskTaxBand        = _filterViewModelFactory.Create <TaxBandFilter, TaxBandLiteDto>().GetInvokedTask();

            return(Task.Factory.ContinueWhenAll(
                       new Task[] { taskUnitOfMeasure, taskNameOfCurrency, taskTaxBand },
                       tasks =>
            {
                viewModel.UnitOfMeasures = taskUnitOfMeasure.Result.MapTo <UnitOfMeasure>();
                viewModel.NameOfCurrencies = taskNameOfCurrency.Result.MapTo <NameOfCurrency>();
                viewModel.TaxBands = taskTaxBand.Result.MapTo <TaxBand>();

                viewModel.EditableObject.Measure = viewModel.UnitOfMeasures.FirstOrDefault(x => x.MEASMNEMO == "КГ");
                viewModel.EditableObject.NameOfCurrency =
                    viewModel.NameOfCurrencies.FirstOrDefault(x => x.Code == "RUB");
                viewModel.EditableObject.TaxBand = viewModel.TaxBands.FirstOrDefault(x => x.Code == "НДС 18%");
            }));
        }
 public ActSelectionOfProbeViewModel(
     IScreen screen,
     IFilterViewModelFactory filterViewModelFactory,
     IUnitOfWorkFactory unitOfWorkFactory,
     IRoutableViewModelManager routableViewModelManager,
     IPrintManager printManager,
     IMessenger messenger)
 {
     _messenger                = messenger;
     _printManager             = printManager;
     _filterViewModelFactory   = filterViewModelFactory;
     HostScreen                = screen;
     _filterViewModelFactory   = filterViewModelFactory;
     _unitOfWorkFactory        = unitOfWorkFactory;
     _routableViewModelManager = routableViewModelManager;
     _Filter = _filterViewModelFactory.Create <CertificateQualityFilter, CertificateQualityLiteDto>();
 }
        public EditableChemicalViewModel(
            IScreen screen,
            IFilterViewModelFactory filterViewModelFactory,
            IValidatorFactory validatorFactory)
            : base(screen)
        {
            _validatorFactory = validatorFactory;
            var loader =
                filterViewModelFactory.Create <DictionaryChemicalIndicatorFilter, DictionaryChemicalIndicatorDto>();

            loader.WhenAny(x => x.Result, x => x.Value)
            .Where(res => res != null)
            .Subscribe(res => DictionaryChemicalIndicators = res);

            loader.WhenAny(x => x.IsBusy, x => x.Value).Subscribe(isBusy => IsChemicalIndicatorValuesLoad = isBusy);
            loader.InvokeCommand.Execute(null);
        }