예제 #1
0
        public ActionResult Index(OnePageCheckoutViewModel onePageCheckoutViewModel)
        {
            onePageCheckoutViewModel.PaymentMethods.Add(new CreditCardPaymentMethod());
            onePageCheckoutViewModel.PaymentMethods.Add(new PaymentMethod() { Name = "PayPal" });

            if (ModelState.IsValid)
            {
                if (onePageCheckoutViewModel.Action == "login")
                {
                    if (onePageCheckoutViewModel.UserName == "jason" && onePageCheckoutViewModel.Password == "123123")
                    {
                        Session["login"] = "******";
                        return RedirectToAction("Index");
                    }
                }
                else if (onePageCheckoutViewModel.Action == "continue")
                {
                    return RedirectToAction("confirmorder");
                }
            }

            return View("OnePageCheckout", "DefaultLayout", onePageCheckoutViewModel);
        }
예제 #2
0
        private OnePageCheckoutViewModel GetCheckoutModel()
        {
            var resultModel = new OnePageCheckoutViewModel();

            resultModel.PaymentMethods.Add(new CreditCardPaymentMethod());
            resultModel.PaymentMethods.Add(new PaymentMethod() { Name = "PayPal" });

            return resultModel;
        }