public ActionResult Add(UserDetail model) { try { _userDetailService.Add(model); TempData["UserMsg"] = "Ekleme işlemi başarılı!"; return(RedirectToAction("List", "UserDetail")); } catch (Exception) { TempData["UserErr"] = "Ekleme işlemi gerçekleştirilemedi!"; return(View()); } }
public ActionResult Register(RegisterViewModel registerModel) { Model.User user = new Model.User() { EMail = registerModel.Mail, Name = registerModel.Firstname, Surname = registerModel.Lastname, Password = registerModel.Password, IsActive = false, ActivationCode = Guid.NewGuid(), UserRoleID = _userRoleService.GetByRoleName("User").UserRoleID //UserRole = _userRoleService.GetByRoleName("User") }; _userService.Add(user); UserDetail userDetail = new UserDetail() { Address = registerModel.Address, BirthDate = registerModel.BirthDate, District = registerModel.District, City = registerModel.City, IsActive = true, UserID = user.UserID }; _userDetailService.Add(userDetail); bool result = MailHelper.SendMail(user.EMail, user.ActivationCode); if (!result) { return(RedirectToAction("NotFound")); } return(View()); }
public ActionResult SignUp(UserDetail model) { model.Role = Role.Member; _userDetailService.Add(model); return(RedirectToAction("HomePage", "Main")); }