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); }
private OnePageCheckoutViewModel GetCheckoutModel() { var resultModel = new OnePageCheckoutViewModel(); resultModel.PaymentMethods.Add(new CreditCardPaymentMethod()); resultModel.PaymentMethods.Add(new PaymentMethod() { Name = "PayPal" }); return resultModel; }