private SocialPipelineUser PopulateUserFromViewModel(AddUserViewModel model) { return new SocialPipelineUser() { FirstName = model.FirstName, LastName = model.LastName, Email = model.Email, Password = model.Password, IsAdmin = model.IsAdmin }; }
public ActionResult Add(AddUserViewModel model) { if (ModelState.IsValid) { var user = PopulateUserFromViewModel(model); user.CompanyId = SocialPipelineUser.CompanyId; try { userService.AddUser(user); return RedirectToAction("Index"); } catch (UnableToAddUserException exception) { ModelState.AddModelError(string.Empty, "There was an issue registering this new user"); } } return View(model); }
public ActionResult Add() { AddUserViewModel model = new AddUserViewModel(); return View(model); }