public ActionResult Registration(UserProfile profile) { // если пароль и логин введены if (ModelState.IsValid && userManager.FindUserByLoginPassword(profile.Login, profile.Password) == null) { userManager.CreateUser(profile.Login, profile.Password); return View("Welcome", (object) profile.Login); } return View(); }
public ActionResult Entrance(UserProfile profile) { var foundUser = userManager.FindUserByLoginPassword(profile.Login, profile.Password); if (ModelState.IsValid && foundUser != null) { FakeSession.User = foundUser; FakeSession.RobotIds = new List<int>(); FakeSession.RobotIds.AddRange(foundUser.Robots.Select(x => x.RobotID)); return RedirectToAction("ShowAllPrograms", "Program"); } return View(); }