コード例 #1
0
        public async Task <ActionResult <QuoteRequestTotals> > CalculateTotals(string number, [FromBody] QuoteRequestFormModel quoteRequest)
        {
            await _quoteRequestBuilder.LoadQuoteRequestAsync(number, WorkContext.CurrentLanguage, WorkContext.CurrentCurrency);

            EnsureQuoteRequestBelongsToCurrentCustomer(_quoteRequestBuilder.QuoteRequest);

            //Apply user changes without saving
            _quoteRequestBuilder.Update(quoteRequest);
            await _quoteRequestBuilder.CalculateTotalsAsync();

            return(_quoteRequestBuilder.QuoteRequest.Totals);
        }
コード例 #2
0
        public async Task <ActionResult> CalculateTotals(string number, QuoteRequestFormModel quoteRequest)
        {
            await _quoteRequestBuilder.LoadQuoteRequestAsync(number, WorkContext.CurrentLanguage, WorkContext.AllCurrencies);

            EnsureThatIsItCustomerQuoteRequest(_quoteRequestBuilder.QuoteRequest);

            //Apply user changes without saving
            _quoteRequestBuilder.Update(quoteRequest);
            await _quoteRequestBuilder.CalculateTotalsAsync();

            return(Json(_quoteRequestBuilder.QuoteRequest.Totals));
        }