예제 #1
0
        public ActionResult Login(LoginViewModel loginViewModel)
        {
            if (ModelState.IsValid)
            {
                if (loginViewModel.UserName == "jason" && loginViewModel.Password == "123123")
                {
                    Session["login"] = "******";
                    return Redirect(loginViewModel.ReturnUrl);
                }
            }

            return RedirectToAction("Index", "OnePageCheckout");
        }
예제 #2
0
        public ActionResult Login()
        {
            LoginViewModel viewModel = new LoginViewModel();

            return View("Login", viewModel);
        }
예제 #3
0
        public ActionResult Login(LoginViewModel loginViewModel)
        {
            if (ModelState.IsValid)
            {
                if (loginViewModel.UserName == "jason" && loginViewModel.Password == "123123")
                {
                    Session["login"] = "******";
                    return RedirectToAction("Index");
                }
                else
                {
                    ModelState.AddModelError("UserName", "username or password is wrong.");
                }
            }

            var resultModel = GetCheckoutModel();
            return View("OnePageCheckout", "DefaultLayout", resultModel);

            //return RedirectToAction("Index");
        }