public ActionResult RegisterNewUser(RegisterNewUserModel model)
{
if (ModelState.IsValid)
{
User user = new User()
{
Id = model.userId,
UserName = model.UserName,
Email = model.Email,
Password = model.Password,
RoleId = 1
};
userRepository.CreateUser(user);
//FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */);
//TODO: redirect to view with relation employee with account
return RedirectToAction("ConnectUserWithEmployee", "Admin");
}
// If we got this far, something failed, redisplay form
return View(model);
}