public ActionResult Register(RegisterModel registerModel) { if (ModelState.IsValid) { Purchase purchase = PurchaseManager.AddUser(registerModel); if (purchase == null) { ModelState.AddModelError("", "Пользователь с таким логином существует "); } else { FormsAuthentication.SetAuthCookie(registerModel.Email, true); FormsAuthentication.SignOut(); return(RedirectToAction("Index", "Home")); } } return(View()); }