public ActionResult NewUser(Praktikum_MVC.Models.NewUser newUser) { if (!ModelState.IsValid) { return View(); } else { newUser.register(); return RedirectToAction("Index", "User", new { success = "true" }); } }
public ActionResult Index(Praktikum_MVC.Models.User user) { if (Session["authenticated"] != null && (string) Session["authenticated"] != "") { Session["authenticated"] = ""; return RedirectToAction("Index", "Home", new { logout = "true" }); } if (user.checkPassword()) { Session["authenticated"] = user.username; return RedirectToAction("Index", "Home", new { login = "******" }); } else { ViewBag.error = true; } return View(); }