コード例 #1
0
        public IEntityAutocompleteSelectorFactory CreateDefaultIncomeCategoryAutocompleteSelectorFactory()
        {
            var incomeCategoryFilter = new IncomeCategoryJournalFilterViewModel();
            var commonServices       = ServicesConfig.CommonServices;
            IFileChooserProvider chooserIncomeProvider = new FileChooser();
            var employeeJournalFactory    = new EmployeeJournalFactory();
            var subdivisionJournalFactory = new SubdivisionJournalFactory();
            var incomeFactory             = new IncomeCategorySelectorFactory();

            return(new IncomeCategoryAutoCompleteSelectorFactory(
                       commonServices,
                       incomeCategoryFilter,
                       chooserIncomeProvider,
                       employeeJournalFactory,
                       subdivisionJournalFactory,
                       incomeFactory));
        }
コード例 #2
0
        public IEntityAutocompleteSelectorFactory CreateSimpleIncomeCategoryAutocompleteSelectorFactory()
        {
            var commonServices            = ServicesConfig.CommonServices;
            var employeeJournalFactory    = new EmployeeJournalFactory();
            var subdivisionJournalFactory = new SubdivisionJournalFactory();
            var incomeFactory             = new IncomeCategorySelectorFactory();

            var incomeCategoryAutocompleteSelectorFactory =
                new SimpleEntitySelectorFactory <IncomeCategory, IncomeCategoryViewModel>(
                    () =>
            {
                var incomeCategoryJournalViewModel =
                    new SimpleEntityJournalViewModel <IncomeCategory, IncomeCategoryViewModel>(
                        x => x.Name,
                        () => new IncomeCategoryViewModel(
                            EntityUoWBuilder.ForCreate(),
                            UnitOfWorkFactory.GetDefaultFactory,
                            commonServices,
                            employeeJournalFactory,
                            subdivisionJournalFactory,
                            incomeFactory
                            ),
                        node => new IncomeCategoryViewModel(
                            EntityUoWBuilder.ForOpen(node.Id),
                            UnitOfWorkFactory.GetDefaultFactory,
                            commonServices,
                            employeeJournalFactory,
                            subdivisionJournalFactory,
                            incomeFactory
                            ),
                        UnitOfWorkFactory.GetDefaultFactory,
                        commonServices
                        )
                {
                    SelectionMode = JournalSelectionMode.Single
                };
                return(incomeCategoryJournalViewModel);
            });

            return(incomeCategoryAutocompleteSelectorFactory);
        }