示例#1
0
        public IncomeCashTransferDocumentViewModel(
            IEntityUoWBuilder uowBuilder,
            IUnitOfWorkFactory unitOfWorkFactory,
            ICategoryRepository categoryRepository,
            IEmployeeRepository employeeRepository,
            ISubdivisionRepository subdivisionRepository,
            IEmployeeJournalFactory employeeJournalFactory,
            ICarJournalFactory carJournalFactory) : base(uowBuilder, unitOfWorkFactory)
        {
            _categoryRepository    = categoryRepository ?? throw new ArgumentNullException(nameof(categoryRepository));
            _employeeRepository    = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository));
            _subdivisionRepository = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository));
            EmployeeAutocompleteSelectorFactory =
                (employeeJournalFactory ?? throw new ArgumentNullException(nameof(employeeJournalFactory)))
                .CreateWorkingEmployeeAutocompleteSelectorFactory();
            CarAutocompleteSelectorFactory =
                (carJournalFactory ?? throw new ArgumentNullException(nameof(carJournalFactory)))
                .CreateCarAutocompleteSelectorFactory();

            if (uowBuilder.IsNewEntity)
            {
                Entity.CreationDate = DateTime.Now;
                Entity.Author       = Cashier;
            }
            CreateCommands();
            UpdateCashSubdivisions();
            UpdateIncomeCategories();
            UpdateExpenseCategories();
            View = new IncomeCashTransferDlg(this);

            ConfigEntityUpdateSubscribes();
            ConfigureEntityPropertyChanges();
        }
示例#2
0
        public IncomeCashTransferDocumentViewModel(IEntityUoWBuilder uowBuilder, IUnitOfWorkFactory unitOfWorkFactory) : base(uowBuilder, unitOfWorkFactory)
        {
            if (uowBuilder.IsNewEntity)
            {
                Entity.CreationDate = DateTime.Now;
                Entity.Author       = Cashier;
            }
            CreateCommands();
            UpdateCashSubdivisions();
            UpdateIncomeCategories();
            UpdateExpenseCategories();
            View = new IncomeCashTransferDlg(this);

            ConfigEntityUpdateSubscribes();
            ConfigureEntityPropertyChanges();
        }