public async Task <ActionResult <AccountingModel> > AccountingAsync(int accountingNumber, DateTimeOffset?statusDate = null)
        {
            IGetAccountingQuery query = new GetAccountingQuery
            {
                AccountingNumber = accountingNumber,
                StatusDate       = statusDate?.LocalDateTime.Date ?? DateTime.Today
            };
            IAccounting accounting = await _queryBus.QueryAsync <IGetAccountingQuery, IAccounting>(query);

            AccountingModel accountingModel = _accountingModelConverter.Convert <IAccounting, AccountingModel>(accounting);

            return(new OkObjectResult(accountingModel));
        }
Exemple #2
0
        public async Task <IActionResult> AccountingInformation(int accountingNumber)
        {
            IGetAccountingQuery query = new GetAccountingQuery
            {
                AccountingNumber = accountingNumber,
                StatusDate       = DateTime.Today
            };
            IAccounting accounting = await _queryBus.QueryAsync <IGetAccountingQuery, IAccounting>(query);

            if (accounting == null)
            {
                return(BadRequest());
            }

            AccountingPresentationViewModel accountingPresentationViewModel = _homeViewModelConverter.Convert <IAccounting, AccountingPresentationViewModel>(accounting);

            return(PartialView("_AccountingPresentationPartial", accountingPresentationViewModel));
        }