コード例 #1
0
        public CommonCashTransferDocumentViewModel(
            IEntityUoWBuilder entityUoWBuilder,
            IUnitOfWorkFactory factory,
            ICategoryRepository categoryRepository,
            IEmployeeRepository employeeRepository,
            ISubdivisionRepository subdivisionRepository) : base(entityUoWBuilder, factory)
        {
            _categoryRepository    = categoryRepository ?? throw new ArgumentNullException(nameof(categoryRepository));
            _employeeRepository    = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository));
            _subdivisionRepository = subdivisionRepository ?? throw new ArgumentNullException(nameof(subdivisionRepository));

            if (entityUoWBuilder.IsNewEntity)
            {
                Entity.CreationDate = DateTime.Now;
                Entity.Author       = Cashier;
            }

            CreateCommands();
            UpdateCashSubdivisions();
            UpdateIncomeCategories();
            UpdateExpenseCategories();
            View = new CommonCashTransferDlg(this);

            Entity.PropertyChanged += Entity_PropertyChanged;

            ConfigureEntityChangingRelations();
            ConfigEntityUpdateSubscribes();
        }
コード例 #2
0
        public CommonCashTransferDocumentViewModel(IEntityUoWBuilder entityUoWBuilder, IUnitOfWorkFactory factory) : base(entityUoWBuilder, factory)
        {
            if (entityUoWBuilder.IsNewEntity)
            {
                Entity.CreationDate = DateTime.Now;
                Entity.Author       = Cashier;
            }
            CreateCommands();
            UpdateCashSubdivisions();
            UpdateIncomeCategories();
            UpdateExpenseCategories();
            View = new CommonCashTransferDlg(this);

            Entity.PropertyChanged += Entity_PropertyChanged;

            ConfigureEntityChangingRelations();
            ConfigEntityUpdateSubscribes();
        }