Beispiel #1
0
        public ViewResult Edit()
        {
            var userAddress = _userRepository.GetUserAddress(this.User.Identity.GetUserId()) ?? new UserAddress
            {
                UserId = User.Identity.GetUserId()
            };

            ViewBag.CountryList = _countriesProvider.FillCountryList();

            return(View(userAddress));
        }
Beispiel #2
0
        public ViewResult Checkout(Cart cart)
        {
            var user = _userRepository.GetUserById(User.Identity.GetUserId());

            cart.UserId = user.Id;
            cart.User   = user;

            var viewModel = new CheckoutViewModel
            {
                Cart                     = cart,
                ShippingMethods          = ShippingMethodsProvider.CreateSelectList(_shippingMethodRepository.GetShippingMethods().ToList()),
                OrderValue               = cart.GetValue(),
                SelectedShippingMethodId = -1
            };

            ViewBag.CountryList = _countriesProvider.FillCountryList();

            return(View(viewModel));
        }