Exemplo n.º 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);
        }
Exemplo n.º 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);
        }