示例#1
0
        public ReviewOrderViewModel Build()
        {
            var viewModel = mapper.Map <CheckoutDetailsModel, ReviewOrderViewModel>(checkoutDetailsModel);

            viewModel.CartItems  = cartItemViewModelBuilder.Build(shoppingCart.Items);
            viewModel.TotalPrice = new Money(shoppingCart.TotalPrice, Currency.Usd).Format("{1}{0:#,0}");

            return(viewModel);
        }
示例#2
0
        public ShoppingCartViewModel Build()
        {
            var viewModel = new ShoppingCartViewModel();

            var cartItemsViewModelList = cartItemViewModelBuilder.Build(shoppingCart.Items);

            viewModel.CartItems  = cartItemsViewModelList;
            viewModel.TotalPrice = new Money(shoppingCart.TotalPrice, Currency.Usd).Format("{1}{0:#,0}");

            if (authentication.IsSignedIn())
            {
                viewModel.IsSignedIn = authentication.IsSignedIn();
                viewModel.Email      = authentication.CustomerData.Email;
            }

            return(viewModel);
        }