public FuelWriteoffDocumentViewModel(
            IEntityUoWBuilder uoWBuilder,
            IUnitOfWorkFactory unitOfWorkFactory,
            IEmployeeService employeeService,
            IFuelRepository fuelRepository,
            ISubdivisionRepository subdivisionRepository,
            ICommonServices commonServices,
            IEmployeeJournalFactory employeeJournalFactory,
            IReportViewOpener reportViewOpener,
            ISubdivisionJournalFactory subdivisionJournalFactory,
            IExpenseCategorySelectorFactory expenseCategorySelectorFactory
            )
            : base(uoWBuilder, unitOfWorkFactory, commonServices)
        {
            this.unitOfWorkFactory     = unitOfWorkFactory ?? throw new ArgumentNullException(nameof(unitOfWorkFactory));
            this.employeeService       = employeeService ?? throw new ArgumentNullException(nameof(employeeService));
            this.fuelRepository        = fuelRepository ?? throw new ArgumentNullException(nameof(fuelRepository));
            this.subdivisionRepository = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository));
            this.commonServices        = commonServices ?? throw new ArgumentNullException(nameof(commonServices));
            EmployeeJournalFactory     = employeeJournalFactory ?? throw new ArgumentNullException(nameof(employeeJournalFactory));
            this.reportViewOpener      = reportViewOpener ?? throw new ArgumentNullException(nameof(reportViewOpener));
            SubdivisionJournalFactory  = subdivisionJournalFactory ?? throw new ArgumentNullException(nameof(subdivisionJournalFactory));
            ExpenseSelectorFactory     =
                expenseCategorySelectorFactory ?? throw new ArgumentNullException(nameof(expenseCategorySelectorFactory));

            CreateCommands();
            UpdateCashSubdivisions();

            TabName = "Акт выдачи топлива";
            if (CurrentEmployee == null)
            {
                AbortOpening("К вашему пользователю не привязан сотрудник, невозможно открыть документ");
            }

            if (UoW.IsNew)
            {
                Entity.Date    = DateTime.Now;
                Entity.Cashier = CurrentEmployee;
            }

            ValidationContext.ServiceContainer.AddService(typeof(IFuelRepository), fuelRepository);
            ConfigureEntries();
        }
        public ExpenseCategoryViewModel(
            IEntityUoWBuilder uowBuilder,
            IUnitOfWorkFactory unitOfWorkFactory,
            ICommonServices commonServices,
            IEmployeeJournalFactory employeeJournalFactory,
            ISubdivisionJournalFactory subdivisionJournalFactory,
            IExpenseCategorySelectorFactory expenseCategorySelectorFactory
            ) : base(uowBuilder, unitOfWorkFactory, commonServices)
        {
            ExpenseCategoryAutocompleteSelectorFactory =
                (expenseCategorySelectorFactory ?? throw new ArgumentNullException(nameof(expenseCategorySelectorFactory)))
                .CreateDefaultExpenseCategoryAutocompleteSelectorFactory();

            var employeeSelectorFactory =
                (employeeJournalFactory ?? throw new ArgumentNullException(nameof(employeeJournalFactory)))
                .CreateEmployeeAutocompleteSelectorFactory();

            SubdivisionAutocompleteSelectorFactory =
                (subdivisionJournalFactory ?? throw new ArgumentNullException(nameof(subdivisionJournalFactory)))
                .CreateDefaultSubdivisionAutocompleteSelectorFactory(employeeSelectorFactory);

            TabName = uowBuilder.IsNewEntity ? "Создание новой категории расхода" : $"{Entity.Title}";
        }
        public ExpenseCategoryJournalViewModel(
            ExpenseCategoryJournalFilterViewModel filterViewModel,
            IUnitOfWorkFactory unitOfWorkFactory,
            ICommonServices commonServices,
            IFileChooserProvider fileChooserProvider,
            IEmployeeJournalFactory employeeJournalFactory,
            ISubdivisionJournalFactory subdivisionJournalFactory,
            IExpenseCategorySelectorFactory expenseCategorySelectorFactory
            ) : base(filterViewModel, unitOfWorkFactory, commonServices)
        {
            _unitOfWorkFactory              = unitOfWorkFactory ?? throw new ArgumentNullException(nameof(unitOfWorkFactory));
            _fileChooserProvider            = fileChooserProvider ?? throw new ArgumentNullException(nameof(fileChooserProvider));
            _employeeJournalFactory         = employeeJournalFactory ?? throw new ArgumentNullException(nameof(employeeJournalFactory));
            _subdivisionJournalFactory      = subdivisionJournalFactory ?? throw new ArgumentNullException(nameof(subdivisionJournalFactory));
            _expenseCategorySelectorFactory =
                expenseCategorySelectorFactory ?? throw new ArgumentNullException(nameof(expenseCategorySelectorFactory));

            TabName = "Категории расхода";

            UpdateOnChanges(
                typeof(ExpenseCategory),
                typeof(Subdivision)
                );
        }