Пример #1
0
        public ActionResult Pay(PaymentAddressViewModel pymentAddressVM)
        {
            if (ModelState.IsValid)
            {
                // from orderViewModel to Logic.Order
                // from Logic.Order to OrderDBModel
                // from OrderDBModel to Logic.Order
                // Logic.Order to orderViewModel or simply take the OrderId

                var order = orderFactory.CreateOrder();

                TryUpdateModel(order);

                order.Username  = User.Identity.Name;
                order.OrderDate = DateTime.Now;

                var shoppingCartId = cardIdentifier.GetCardId(this.HttpContext);
                var cart           = shoppingCart.GetShoppingCart(shoppingCartId);

                var orderId = cart.SaveOrder(order);

                return(RedirectToAction("Complete", new { id = orderId }));
            }

            return(View(pymentAddressVM));
        }
Пример #2
0
        public ActionResult Pay()
        {
            PaymentAddressViewModel paymentAddressVM = new PaymentAddressViewModel();

            paymentAddressVM.City = new SelectList(new string[] { "Sofia", "Plovdiv" });

            return(View(paymentAddressVM));
        }