Beispiel #1
0
        public ActionResult ProcessOrder(ContactViewModel contactModel, string returnUrl)
        {
            if (ModelState.IsValid)
            {
                ShoppingCartModel cart = GetCart();
                var model = new CreateOrderViewModel
                {
                    Cart      = cart,
                    OrderInfo = contactModel,
                };
                model.OrderInfo.Comment = contactModel.Comment;
                apiModelOrder.SaveOrderToDb("api/APIDbOrder", model);

                cart.Clear();

                return(PartialView("_ThankYou"));
            }
            apiModelPayment.Payments      = apiModelPayment.GetAllPaymentsFromDb("api/APIDbPayment");
            contactModel.PaymentTypeList  = apiModelPayment.Payments;
            apiModelDelivery.Deliveries   = apiModelDelivery.GetAllDeliveriesFromDb("api/APIDbDelivery");
            contactModel.DeliveryTypeList = apiModelDelivery.Deliveries;
            return(PartialView("OrderDetails", contactModel));
        }