public ActionResult Registration(User user) { //if (SessionAccount.GetId() != null) return Redirect(HomeIndex); var message = ""; user = _dataManager.UserManager.Register(user.Fio, user.Login, user.Password, ref message); if (user == null) { ViewBag.Message = message; return(View()); } SessionAccount.AuthenticateAccount(user); TempData["sAlertMessage"] = $"Добро пожаловать, {SessionAccount.GetFio()}!"; return(Redirect("/Account/ProfilePerson")); }
public ActionResult Login(User user) { //if (SessionAccount.GetId() == null) return Redirect(HomeIndex); user = _dataManager.UserManager.Authenticate(user.Login, user.Password); if (user != null) { SessionAccount.AuthenticateAccount(user); ViewBag.Message = $"Добро пожаловать, {SessionAccount.GetFio()}!"; return(Redirect(DistributionPage)); } ViewBag.Message = "Не верный логин или пароль"; return(View()); }