Exemplo n.º 1
0
        public ActionResult Register(string EmailId, string Password, string Firstname, string Lastname)
        {
            UserRegistrationModel userPersistentmodel = new UserRegistrationModel();
            if (ModelState.IsValid)
            {
                var result = _userRepository.CreateUser(EmailId, Password, Firstname, Lastname);

                userPersistentmodel.FirstName = Firstname;
                userPersistentmodel.LastName = Lastname;
                userPersistentmodel.Password = Password;
                userPersistentmodel.Result = result.UserPersistenceResult.ToString();

                if (result.UserPersistenceResult == UserPersistenceResult.UsernameInUse)
                {
                    return RedirectToAction("Register", "Account", userPersistentmodel);
                }
                if (result.UserPersistenceResult == UserPersistenceResult.Successful)
                {
                    return RedirectToAction("Login", "Account");
                }
            }
            return RedirectToAction("Register", "Account", userPersistentmodel);
        }
Exemplo n.º 2
0
 public ActionResult Register(UserRegistrationModel userRegistrationModel)
 {
     return View(userRegistrationModel);
 }