Exemplo n.º 1
0
        protected override async Task PrepareReadAsync(AccountingIdentificationState accountingIdentificationState)
        {
            NullGuard.NotNull(accountingIdentificationState, nameof(accountingIdentificationState));

            _accountingModel ??= await AccountingModelHandler.ForAsync(accountingIdentificationState.AccountingIdentifier);

            if (_includePostingLines == false || PostingLineModelHandler == null)
            {
                return;
            }

            _postingLineModelCollection ??= await PostingLineModelHandler.ForAsync(accountingIdentificationState.AccountingIdentifier);
        }
Exemplo n.º 2
0
        protected override async Task OnUpdateAsync(TAccount account, TAccountModel accountModel)
        {
            NullGuard.NotNull(account, nameof(account))
            .NotNull(accountModel, nameof(accountModel));

            accountModel.AccountingIdentifier = account.Accounting.Number;
            accountModel.Accounting           = await AccountingModelHandler.ForAsync(account.Accounting.Number);

            accountModel.AccountNumber            = account.AccountNumber;
            accountModel.BasicAccount.AccountName = account.AccountName;
            accountModel.BasicAccount.Description = account.Description;
            accountModel.BasicAccount.Note        = account.Note;
        }
Exemplo n.º 3
0
        protected override async Task <TAccountModel> OnCreateAsync(TAccount account, TAccountModel accountModel)
        {
            NullGuard.NotNull(account, nameof(account))
            .NotNull(accountModel, nameof(accountModel));

            EntityEntry <BasicAccountModel> basicAccountEntityEntry = await DbContext.BasicAccounts.AddAsync(accountModel.BasicAccount);

            accountModel.Accounting = await AccountingModelHandler.ForAsync(account.Accounting.Number);

            accountModel.BasicAccount = basicAccountEntityEntry.Entity;

            return(accountModel);
        }
        protected override async Task PrepareReadAsync(AccountingIdentificationState accountingIdentificationState)
        {
            NullGuard.NotNull(accountingIdentificationState, nameof(accountingIdentificationState));

            _accountingModel ??= await _accountingModelHandler.ForAsync(accountingIdentificationState.AccountingIdentifier);

            _accountModelCollection ??= await _accountModelHandler.ForAsync(accountingIdentificationState.AccountingIdentifier);

            _budgetAccountModelCollection ??= await _budgetAccountModelHandler.ForAsync(accountingIdentificationState.AccountingIdentifier);

            _contactAccountModelCollection ??= await _contactAccountModelHandler.ForAsync(accountingIdentificationState.AccountingIdentifier);

            if (_numberOfPostingLines.HasValue || _applyingPostingLines)
            {
                await ForAsync(accountingIdentificationState.AccountingIdentifier, false);
            }
        }