public ActionResult Register(RegisterViewModel viewmodel) { try { _accountModel.CreteUser(viewmodel); _notyMessage = new NotyMessage { ResponseMessage = "User has been registered.", ResponseType = NotyType.success }; } catch (MembershipException ex) { _notyMessage = new NotyMessage { ResponseMessage = ex.Message, ResponseType = NotyType.error }; } catch (Exception ex) { _notyMessage = new NotyMessage { ResponseMessage = SystemMessage.GeneralErrorMessage, ResponseType = NotyType.error }; } TempData["NotyMessage"] = _notyMessage; return View(viewmodel); }
public void CreteUser(RegisterViewModel viewmodel) { User entity = new User { Email = viewmodel.Email, Username = viewmodel.UserName, Password = viewmodel.Password }; _membershipService.CreteUser(entity); }
public ActionResult Register() { RegisterViewModel viewmodel = new RegisterViewModel(); return View(viewmodel); }